Skip to main content
Glama
danilat
by danilat

zaragoza-bizi-estimations

Check real-time bike availability and free parking slots at Zaragoza Bizi stations to plan your bike-sharing trips.

Instructions

Get the estimation of bikes and free slots in a Bizi station in Zaragoza in realtime

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stationYes

Implementation Reference

  • The handler function that implements the tool logic: fetches bike and free slot estimations from the Bizi API for a given station ID and returns the JSON data or an error message.
    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}`,
            },
          ],
        };
      }
    }
  • Zod schema for the tool input: requires a numeric 'station' parameter.
    { station: z.number() },
  • index.js:160-184 (registration)
    Registration of the 'zaragoza-bizi-estimations' tool on the MCP server with 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}`,
              },
            ],
          };
        }
      }
    );

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