Skip to main content
Glama
jankowtf

MCP Server Template for Cursor IDE

by jankowtf

fetch_railway_docs

Retrieve Railway CLI documentation directly within Cursor IDE to access deployment guides and command references.

Instructions

Fetches the most recent Railway CLI documentation. Optionally, provide a custom URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoOptional custom URL for fetching Railway CLI docs.

Implementation Reference

  • The core handler function that asynchronously fetches Railway CLI documentation from the given URL (default: https://docs.railway.app/guides/cli), returns the raw HTML as TextContent, and handles various errors like timeouts and HTTP errors.
    async def fetch_railway_docs(
        url: str = "https://docs.railway.app/guides/cli",
    ) -> list[types.TextContent]:
        """
        Fetch the most recent Railway CLI documentation.
        """
        headers = {
            "User-Agent": "MCP Railway Docs Fetcher (github.com/modelcontextprotocol/python-sdk)"
        }
    
        try:
            timeout = httpx.Timeout(10.0, connect=5.0)
            async with httpx.AsyncClient(
                follow_redirects=True, headers=headers, timeout=timeout
            ) as client:
                response = await client.get(url)
                response.raise_for_status()
    
                # Optionally, parse specific sections of the docs here
                return [types.TextContent(type="text", text=response.text)]
        except httpx.TimeoutException:
            return [
                types.TextContent(
                    type="text",
                    text="Error: Request timed out while trying to fetch the Railway CLI docs.",
                )
            ]
        except httpx.HTTPStatusError as e:
            return [
                types.TextContent(
                    type="text",
                    text=f"Error: HTTP {e.response.status_code} error while fetching the Railway CLI docs.",
                )
            ]
        except Exception as e:
            return [
                types.TextContent(
                    type="text", text=f"Error: Failed to fetch Railway CLI docs: {str(e)}"
                )
            ]
  • Dispatch logic within the main @app.call_tool() handler (fetch_tool) that checks for the tool name 'fetch_railway_docs' and invokes the handler with the provided or default URL.
    if name == "fetch_railway_docs":
        url = arguments.get("url", "https://docs.railway.app/guides/cli")
        return await fetch_railway_docs(url)
  • Tool object registration returned by @app.list_tools(), specifying the name, description, and input schema (optional 'url' parameter). This defines the tool for MCP clients.
    types.Tool(
        name="fetch_railway_docs",
        description="Fetches the most recent Railway CLI documentation. Optionally, provide a custom URL.",
        inputSchema={
            "type": "object",
            "properties": {
                "url": {
                    "type": "string",
                    "description": "Optional custom URL for fetching Railway CLI docs.",
                },
            },
        },
    ),
  • Input schema definition for the 'fetch_railway_docs' tool, specifying an optional 'url' string property.
    inputSchema={
        "type": "object",
        "properties": {
            "url": {
                "type": "string",
                "description": "Optional custom URL for fetching Railway CLI docs.",
            },
        },
    },
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but offers minimal information. It states what the tool does but doesn't describe how it behaves: no mention of rate limits, authentication requirements, error handling, response format, or whether it caches results. The agent must infer behavior from the tool name and description alone.

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

Conciseness4/5

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

The description is appropriately concise with two clear sentences that communicate the core functionality. It's front-loaded with the primary purpose and follows with the optional parameter information. There's no wasted verbiage, though it could potentially benefit from slightly more detail given the lack of annotations.

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 lack of annotations and output schema, the description is insufficiently complete. It doesn't explain what format the documentation returns (HTML, markdown, structured data?), whether there are size limitations, error conditions, or how 'most recent' is determined. For a tool that fetches external documentation, more contextual information would be helpful to the agent.

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 description coverage is 100%, with the single parameter 'url' clearly documented in the schema as 'Optional custom URL for fetching Railway CLI docs.' The description adds minimal value beyond this, merely restating that a custom URL can be provided. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

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 tool's purpose with a specific verb ('fetches') and resource ('most recent Railway CLI documentation'), making it immediately understandable. However, it doesn't explicitly distinguish itself from its sibling 'fetch_railway_docs_optimized', which appears to serve a similar function with potential performance differences.

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 minimal guidance, mentioning the optional custom URL parameter but offering no context about when to use this tool versus alternatives like 'fetch_railway_docs_optimized'. There's no mention of typical use cases, prerequisites, or scenarios where this tool would be preferred over other documentation-fetching methods.

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/jankowtf/mcp-hitchcode'

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