Skip to main content
Glama
luizzzvictor

mcp-comexstat

by luizzzvictor

getCities

Retrieve city data for analysis and integration with trade statistics using the MCP server mcp-comexstat.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool registration and handler for 'getCities'. This inline async function executes the tool by calling ComexstatClient.getCities() and returning the JSON-stringified result as text content.
    this.server.tool("getCities", {}, async () => ({ content: [ { type: "text", text: JSON.stringify(await this.client.getCities()), }, ], }));
  • Implementation of getCities in ComexstatClient, which fetches the list of Brazilian cities from the '/tables/cities' API endpoint using the internal get method.
    async getCities(): Promise<{ data: Array<{ id: string; text: string; noMunMin: string; }>; }> { return this.get("/tables/cities"); }
  • TypeScript type definition for the output of getCities, defining the structure of the cities data returned from the API.
    data: Array<{ id: string; text: string; noMunMin: string; }>; }> {
  • Registration of the 'getCities' tool on the MCP server with empty input schema.
    this.server.tool("getCities", {}, async () => ({ content: [ { type: "text", text: JSON.stringify(await this.client.getCities()), }, ], }));

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/luizzzvictor/mcp-comexstat'

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