Skip to main content
Glama
jeebus87

reddirect

by jeebus87

Unsubscribe from Subreddit

unsubscribe_subreddit

Unsubscribe from a subreddit by providing its name without the r/ prefix.

Instructions

Unsubscribe from a subreddit.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subredditYesSubreddit name without r/ prefix

Implementation Reference

  • Registration of the unsubscribe_subreddit tool with name, metadata, input schema, and handler.
    server.registerTool(
      "unsubscribe_subreddit",
      {
        title: "Unsubscribe from Subreddit",
        description: "Unsubscribe from a subreddit.",
        inputSchema: z.object({
          subreddit: z.string().describe("Subreddit name without r/ prefix"),
        }),
      },
      async ({ subreddit }) => {
        try {
          await client.post("/api/subscribe", {
            sr_name: subreddit,
            action: "unsub",
          });
          return {
            content: [
              {
                type: "text" as const,
                text: JSON.stringify({ success: true, subreddit, unsubscribed: true }, null, 2),
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text" as const,
                text: `Error unsubscribing: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
            isError: true,
          };
        }
      }
    );
  • Input schema for unsubscribe_subreddit: requires a 'subreddit' string (without r/ prefix).
    inputSchema: z.object({
      subreddit: z.string().describe("Subreddit name without r/ prefix"),
    }),
  • Handler function that POSTs to /api/subscribe with action 'unsub' to unsubscribe from a subreddit.
      async ({ subreddit }) => {
        try {
          await client.post("/api/subscribe", {
            sr_name: subreddit,
            action: "unsub",
          });
          return {
            content: [
              {
                type: "text" as const,
                text: JSON.stringify({ success: true, subreddit, unsubscribed: true }, null, 2),
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text" as const,
                text: `Error unsubscribing: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
            isError: true,
          };
        }
      }
    );
  • src/index.ts:13-33 (registration)
    Import and invocation of registerSubscriptionTools which registers the unsubscribe_subreddit tool.
    import { register as registerSubscriptionTools } from "./tools/subscriptions.js";
    import { DEFAULT_SESSION_PATH } from "./constants.js";
    
    const server = new McpServer({
      name: "reddirect",
      version: "1.0.0",
    });
    
    const sessionPath =
      process.env.REDDIT_MCP_SESSION_PATH || DEFAULT_SESSION_PATH;
    
    const client = new RedditClient(sessionPath);
    
    registerAuthTools(server, client);
    registerBrowseTools(server, client);
    registerSearchTools(server, client);
    registerPostTools(server, client);
    registerVoteTools(server, client);
    registerSaveTools(server, client);
    registerInboxTools(server, client);
    registerSubscriptionTools(server, client);
Behavior2/5

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

No annotations are provided, and the description does not disclose behavioral traits such as authentication requirements, side effects, or success/failure conditions. The bare description does not inform the agent about state changes or permissions needed.

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

Conciseness5/5

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

The description is extremely concise, consisting of a single sentence. It is front-loaded and waste-free, though this brevity may contribute to the lack of detail in other dimensions.

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

Completeness3/5

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

Given the simplicity of the tool (one parameter, no output schema), the description is minimally complete. However, it does not explain the expected result of the action or any conditions, which could be important for an agent to handle errors or confirm outcomes. More context, such as requiring a prior subscription, would improve completeness.

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?

The schema covers 100% of parameter descriptions, including the note about omitting 'r/'. The description adds no further meaning beyond what the schema already provides, so it meets the baseline without additional clarification.

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

Purpose5/5

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

The description clearly states the action (unsubscribe) and the resource (subreddit). It distinguishes from sibling 'subscribe_subreddit' by being the inverse operation. The one-sentence description is direct and sufficient.

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 guidance is provided on when to use this tool versus alternatives like 'subscribe_subreddit' or any prerequisites (e.g., must be subscribed first). The description lacks contextual cues for appropriate use.

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

Install Server

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/jeebus87/reddirect'

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