Skip to main content
Glama

zaragoza-tram-estimations

Retrieve real-time tram arrival estimations for any station in Zaragoza by providing the station number. Access accurate timings via the DNDzgz MCP Server API for efficient travel planning.

Instructions

Get the estimation of when arrives to a tram station in Zaragoza in realtime

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stationYes

Implementation Reference

  • index.js:19-38 (handler)
    Handler function that fetches real-time tram arrival estimations for a given station ID from the external API and returns the data as JSON string in text content, or an error message if the request fails.
    async ({ station }) => { const response = await fetch( `https://dndzgz.herokuapp.com/services/tram/${station}` ); if (response.ok) { const data = await response.json(); return { content: [{ type: "text", text: JSON.stringify(data) }], }; } else { return { content: [ { type: "text", text: `Is not possible to get the estimate for ${station}`, }, ], }; } }
  • Input schema defining the required 'station' parameter as a number (tram station ID).
    { station: z.number() },
  • index.js:15-39 (registration)
    Registration of the 'zaragoza-tram-estimations' tool on the MCP server, specifying name, description, input schema, and handler function.
    server.tool( "zaragoza-tram-estimations", "Get the estimation of when arrives to a tram station in Zaragoza in realtime", { station: z.number() }, async ({ station }) => { const response = await fetch( `https://dndzgz.herokuapp.com/services/tram/${station}` ); if (response.ok) { const data = await response.json(); return { content: [{ type: "text", text: JSON.stringify(data) }], }; } else { return { content: [ { type: "text", text: `Is not possible to get the estimate for ${station}`, }, ], }; } } );

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/danilat/mcp-dndzgz'

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