Skip to main content
Glama
jankowtf

MCP Server Template for Cursor IDE

by jankowtf

fetch_railway_docs

Retrieve the latest Railway CLI documentation directly within Cursor IDE. Optionally, fetch docs from a custom URL to access specific or updated content.

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 primary handler function that implements the logic for fetching Railway CLI documentation from the given URL (default: https://docs.railway.app/guides/cli), handling errors, and returning TextContent.
    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)}" ) ]
  • The tool registration in list_tools(), defining the name, description, and input schema (optional 'url' parameter).
    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.", }, }, }, ),
  • Dispatch logic within the generic tool handler (@app.call_tool()) that routes calls to 'fetch_railway_docs' to the specific implementation.
    if name == "fetch_railway_docs": url = arguments.get("url", "https://docs.railway.app/guides/cli") return await fetch_railway_docs(url)

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