zaragoza-bizi-estimations
Retrieve real-time bike and free slot estimates for Bizi stations in Zaragoza using station identifiers to plan bike-sharing trips efficiently.
Instructions
Get the estimation of bikes and free slots in a Bizi station in Zaragoza in realtime
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| station | Yes |
Implementation Reference
- index.js:164-183 (handler)Handler function that fetches real-time estimations of bikes and free slots for a specific Bizi station in Zaragoza from the external API and returns the data as JSON string.async ({ station }) => { const response = await fetch( `https://dndzgz.herokuapp.com/services/bizi/${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 the Bizi station ${station}`, }, ], }; } }
- index.js:163-163 (schema)Input schema defining the required 'station' parameter as a number.{ station: z.number() },
- index.js:160-184 (registration)Registration of the 'zaragoza-bizi-estimations' tool using server.tool(), including name, description, schema, and handler.server.tool( "zaragoza-bizi-estimations", "Get the estimation of bikes and free slots in a Bizi station in Zaragoza in realtime", { station: z.number() }, async ({ station }) => { const response = await fetch( `https://dndzgz.herokuapp.com/services/bizi/${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 the Bizi station ${station}`, }, ], }; } } );