search_posts

Pack: reddit · Endpoint: https://gateway.pipeworx.io/reddit/mcp

Search Reddit posts by keyword — across all subreddits, or scoped to one via the subreddit argument (“search r/ for X”). Sort by relevance (default), hot, top, new, or comments. Returns post id, title, author, subreddit, permalink, and date.

Parameters

NameTypeRequiredDescription
querystringyesSearch query.
subredditstringnoOptional subreddit to restrict the search to (e.g. “python”).
sortstringnorelevance (default), hot, top, new, comments.
limitnumbernoNumber of results (default 10, max 100).

Example call

Arguments

{
  "query": "machine learning"
}

curl

curl -X POST https://gateway.pipeworx.io/reddit/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"search_posts","arguments":{"query":"machine learning"}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('search_posts', {
  "query": "machine learning"
});

More examples

{
  "query": "climate change",
  "limit": 50,
  "sort": "top"
}

Response shape

Full JSON Schema
{
  "type": "object",
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "enum": [
            true
          ],
          "description": "Success flag"
        },
        "query": {
          "type": "string",
          "description": "Search query executed"
        },
        "sort": {
          "type": "string",
          "description": "Sort order used"
        },
        "count": {
          "type": "number",
          "description": "Number of results returned"
        },
        "posts": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Post ID"
              },
              "title": {
                "type": "string",
                "description": "Post title"
              },
              "subreddit": {
                "type": "string",
                "description": "Subreddit name"
              },
              "author": {
                "type": "string",
                "description": "Post author"
              },
              "score": {
                "type": "number",
                "description": "Upvote score"
              },
              "url": {
                "type": "string",
                "description": "Post URL"
              },
              "permalink": {
                "type": "string",
                "description": "Full Reddit permalink"
              },
              "num_comments": {
                "type": "number",
                "description": "Number of comments"
              },
              "created_utc": {
                "type": "number",
                "description": "Creation timestamp (UTC)"
              },
              "is_self": {
                "type": "boolean",
                "description": "Is self-post"
              },
              "selftext": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Self-post text content"
              },
              "flair": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Link flair text"
              }
            },
            "required": [
              "id",
              "title",
              "subreddit",
              "author",
              "score",
              "url",
              "permalink",
              "num_comments",
              "created_utc",
              "is_self",
              "selftext",
              "flair"
            ]
          }
        }
      },
      "required": [
        "ok",
        "query",
        "sort",
        "count",
        "posts"
      ]
    },
    {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "enum": [
            false
          ],
          "description": "Failure flag"
        },
        "query": {
          "type": "string",
          "description": "Search query requested"
        },
        "sort": {
          "type": "string",
          "description": "Sort order requested"
        },
        "posts": {
          "type": "array",
          "description": "Empty posts array on failure"
        },
        "reason": {
          "type": "string",
          "enum": [
            "reddit_blocked",
            "reddit_rate_limited",
            "not_found"
          ],
          "description": "Failure reason"
        },
        "message": {
          "type": "string",
          "description": "Failure message"
        },
        "hint": {
          "type": "string",
          "description": "Optional hint for recovery"
        }
      },
      "required": [
        "ok",
        "query",
        "sort",
        "posts",
        "reason",
        "message"
      ]
    }
  ]
}

Connect

Add this to your MCP client config, or use one-click install buttons:

{
  "mcpServers": {
    "reddit": {
      "url": "https://gateway.pipeworx.io/reddit/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build July 21, 2026