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
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Optional custom URL for fetching Railway CLI docs. |
Implementation Reference
- mcp_hitchcode/server.py:66-106 (handler)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)}" ) ]
- mcp_hitchcode/server.py:589-601 (registration)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.", }, }, }, ),
- mcp_hitchcode/server.py:433-435 (handler)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)