Skip to main content
Glama
harshil1712

Berlin Transport MCP Server

by harshil1712

search_stops

Search public transport stops in Berlin-Brandenburg using the Berlin Transport MCP Server. Input a query to find relevant stops and access transport data efficiently.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query for stops

Implementation Reference

  • Handler function for 'search_stops' tool: constructs VBB API URL for /locations with query param, fetches data, and returns JSON stringified response.
    async ({ query }) => { const url = new URL("/locations", VBB_API_BASE); url.searchParams.set("query", query); url.searchParams.set("poi", "false"); url.searchParams.set("addresses", "false"); const response = await fetch(url); const data = await response.json(); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }], }; }
  • Input schema for 'search_stops' tool using Zod: requires a 'query' string parameter.
    { query: z.string().describe("Search query for stops"), },
  • src/index.ts:17-33 (registration)
    Registration of 'search_stops' tool in the MCP server using this.server.tool, including schema and handler implementation.
    "search_stops", { query: z.string().describe("Search query for stops"), }, async ({ query }) => { const url = new URL("/locations", VBB_API_BASE); url.searchParams.set("query", query); url.searchParams.set("poi", "false"); url.searchParams.set("addresses", "false"); const response = await fetch(url); const data = await response.json(); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }], }; } );

Other Tools

Related 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/harshil1712/berlin-transport-mcp'

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