Skip to main content
Glama
luizzzvictor

mcp-comexstat

by luizzzvictor

getFilterValues

Retrieve specific filter values from the mcp-comexstat server to streamline data queries. Input a filter and language to extract relevant information for analysis or processing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterYes
languageNo

Implementation Reference

  • Core handler function that fetches filter values from the Comexstat API endpoint `/general/filters/${filter}` and extracts the first array of {id, text} objects.
    async getFilterValues(
      filter: string,
      language: string = "pt"
    ): Promise<Array<{ id: string; text: string }>> {
      const response = await this.get<{
        data: Array<Array<{ id: string; text: string }>>;
        success: boolean;
        message: string | null;
        processo_info: any;
        language: string;
      }>(`/general/filters/${filter}`, { language });
    
      // The API returns an array of arrays, but we only need the first array
      return response.data[0];
    }
  • Registers the 'getFilterValues' tool with the MCP server, providing input schema and a handler that delegates to ComexstatClient.getFilterValues and returns JSON-formatted response as text content.
    this.server.tool(
      "getFilterValues",
      {
        filter: z.string(),
        language: z.string().optional(),
      },
      async ({ filter, language }) => ({
        content: [
          {
            type: "text",
            text: JSON.stringify(
              await this.client.getFilterValues(filter, language)
            ),
          },
        ],
      })
    );
  • Zod schema defining the input parameters for the getFilterValues tool: required 'filter' string and optional 'language' string.
    {
      filter: z.string(),
      language: z.string().optional(),
    },

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