Skip to main content
Glama

unsubscribe

Stop receiving real-time notifications for file or directory changes by removing active monitoring subscriptions.

Instructions

Unsubscribe from changes on a file or directory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Implementation Reference

  • Registration of the 'unsubscribe' tool, defining its name, description, and input schema requiring a 'path' parameter.
    Tool(
        name="unsubscribe",
        description="Unsubscribe from changes on a file or directory",
        inputSchema={
            "type": "object",
            "properties": {"path": {"type": "string"}},
            "required": ["path"],
        },
    ),
  • The handler logic within the call_tool function that executes the unsubscribe tool: removes the session from the watched path's subscribers and cleans up empty entries.
    elif name == "unsubscribe":
        assert path_str is not None, "path_str should not be None for unsubscribe tool"
        p = Path(path_str).expanduser().resolve()
        subs = watched.get(p)
        if subs and session in subs:
            subs.remove(session)
            if not subs:
                del watched[p]
            return [TextContent(type="text", text=f"Unsubscribed from {p}")]
        return [TextContent(type="text", text=f"Not subscribed to {p}")]
  • Additional resource-specific unsubscribe handler using the MCP resource unsubscribe protocol, with identical logic to the tool.
    @server.unsubscribe_resource()
    async def unsubscribe_resource_handler(uri: AnyUrl) -> None:
        if not uri.path:
            return
        p = Path(uri.path).resolve()
        session = server.request_context.session
        subs = watched.get(p)
        if subs and session in subs:
            subs.remove(session)
            if not subs:
                del watched[p]
  • Input schema for the unsubscribe tool, specifying an object with a required 'path' string property.
    inputSchema={
        "type": "object",
        "properties": {"path": {"type": "string"}},
        "required": ["path"],
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Unsubscribe from changes') but doesn't explain what 'changes' refers to, whether this operation is reversible, what permissions are required, or what happens after unsubscribing (e.g., notifications stop). For a mutation tool with zero annotation coverage, this leaves significant behavioral gaps.

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 a single, efficient sentence with zero waste—it directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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 complexity (a mutation operation with no annotations, no output schema, and low schema coverage), the description is incomplete. It lacks details on behavioral traits, parameter usage, output expectations, and differentiation from siblings, making it inadequate for informed tool selection and invocation.

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

Parameters2/5

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

The input schema has 1 parameter with 0% description coverage, so the schema provides no semantic information. The description mentions 'a file or directory' but doesn't clarify what the 'path' parameter represents (e.g., format, examples, or constraints). It adds minimal value beyond the schema's structural definition.

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 ('Unsubscribe from changes') and the target resource ('on a file or directory'), providing a specific verb+resource combination. However, it doesn't explicitly distinguish this tool from its sibling 'subscribe' or 'subscribe_default', which would require mentioning what makes 'unsubscribe' different from those subscription tools.

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?

The description provides no guidance on when to use this tool versus alternatives like 'list_watched' or when not to use it. There's no mention of prerequisites (e.g., needing an existing subscription) or contextual cues for selection among sibling tools, leaving usage decisions ambiguous.

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/hesreallyhim/mcp-observer-server'

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