Skip to main content
Glama
Decodo

Decodo MCP Server

reddit_subreddit

Read-only

Extract and automatically parse Reddit subreddit posts by providing the subreddit URL.

Instructions

Scrape Reddit subreddit results with automatic parsing

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to subreddit

Implementation Reference

  • The handler function that executes the tool logic: takes scraping params with a 'url', calls the ScraperAPI client with target REDDIT_SUBREDDIT, transforms the response by removing high-char-count fields like 'preview' and 'media_metadata', and returns the result as text content.
        async (scrapingParams: ScrapingMCPParams, extra: ProgressExtra) => {
          const params = {
            ...scrapingParams,
            target: SCRAPER_API_TARGETS.REDDIT_SUBREDDIT,
          } satisfies ScraperAPIParams;
    
          const { data } = await sapiClient.scrape<object>({ auth, scrapingParams: params, extra });
    
          const { data: text } = this.transformResponse({ data });
    
          return {
            content: [
              {
                type: 'text',
                text,
              },
            ],
          };
        }
      );
    };
  • The transformResponse method that strips 'preview' and 'media_metadata' fields from the scraped data (to reduce payload size) and stringifies the result.
    transformResponse = ({ data }: { data: object }) => {
      for (const fieldToRemove of RedditSubredditTool.FIELDS_WITH_HIGH_CHAR_COUNT) {
        data = removeKeyFromNestedObject({ obj: data, keyToRemove: fieldToRemove });
      }
    
      return { data: JSON.stringify(data) };
    };
  • Input schema for the tool: requires a single 'url' string parameter describing the subreddit URL.
    inputSchema: {
      url: z.string().describe('URL to subreddit'),
    },
  • The register method that registers the tool named 'reddit_subreddit' with the MCP server, including input schema, annotations (readOnlyHint, openWorldHint), and the handler callback.
    register = ({ server, sapiClient, auth }: ToolRegistrationArgs) => {
      server.registerTool(
        'reddit_subreddit',
        {
          description: 'Scrape Reddit subreddit results with automatic parsing',
          inputSchema: {
            url: z.string().describe('URL to subreddit'),
          },
          annotations: {
            readOnlyHint: true,
            openWorldHint: true,
          },
        },
        async (scrapingParams: ScrapingMCPParams, extra: ProgressExtra) => {
          const params = {
            ...scrapingParams,
            target: SCRAPER_API_TARGETS.REDDIT_SUBREDDIT,
          } satisfies ScraperAPIParams;
    
          const { data } = await sapiClient.scrape<object>({ auth, scrapingParams: params, extra });
    
          const { data: text } = this.transformResponse({ data });
    
          return {
            content: [
              {
                type: 'text',
                text,
              },
            ],
          };
        }
      );
  • Instantiation of RedditSubredditTool in the allTools array of the base server, which is later registered via registerTools/registerAllTools.
    new RedditSubredditTool(),
    new RedditUserTool(),
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations provide readOnlyHint and openWorldHint, but the description adds only 'automatic parsing'. It fails to disclose important behavioral traits such as rate limits, pagination behavior, or output format. The description does not contradict annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, efficiently conveying the core purpose. However, it is overly minimal and omits useful context that could be added without sacrificing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one param, no output schema), the description is too sparse. It does not explain the return value, pagination, or what 'automatic parsing' produces. This leaves the agent with incomplete information for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with one parameter ('url') described as 'URL to subreddit'. The description adds no extra meaning, such as URL format or example. Baseline 3 is appropriate given high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('scrape') and resource ('Reddit subreddit results'), and mentions 'automatic parsing'. It distinguishes from siblings like 'reddit_post' and 'reddit_user', which focus on specific entities. However, it does not specify what 'results' entails (e.g., posts, metadata).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives. While siblings hint at specialization, the description lacks any 'when to use' or 'when not to use' context, leaving the agent to infer usage from names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Decodo/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server