search_posts
Pack: reddit · Endpoint: https://gateway.pipeworx.io/reddit/mcp
Search Reddit posts by keyword or phrase across all subreddits. Returns matching posts with titles, scores, subreddits, authors, and URLs.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
query | string | yes | Search query |
limit | number | no | Number of results to return (default: 10, max: 100) |
sort | string | no | Sort order: relevance, hot, top, new, comments (default: relevance) |
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
{
"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.