Skip to main content
Glama
dan1d

mercadolibre-mcp

get_categories

Get all top-level categories for a MercadoLibre site. Specify a site ID to retrieve structured category listings for navigation or filtering.

Instructions

List all top-level categories for a MercadoLibre site.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
site_idNoSite ID (default: MLA)

Implementation Reference

  • The actual handler/implementation of get_categories. Calls the MercadoLibre API to list all top-level categories for a given site (defaults to MLA).
    export async function getCategories(
      client: MercadoLibreClient,
      params?: GetCategoriesParams
    ): Promise<unknown> {
      const siteId = params?.site_id ?? "MLA";
      return client.get(`/sites/${encodeURIComponent(siteId)}/categories`);
    }
  • TypeScript interface for the input parameters of get_categories. Contains an optional site_id field.
    export interface GetCategoriesParams {
      site_id?: string;
    }
  • MCP server registration of the 'get_categories' tool with description and Zod schema. This is where the tool is exposed to MCP clients.
    server.tool(
      "get_categories",
      "List all top-level categories for a MercadoLibre site.",
      {
        site_id: z.string().optional().describe("Site ID (default: MLA)"),
      },
      async (params) => {
        try {
          const result = await tools.get_categories(params);
          return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
        } catch (error) {
          const message = error instanceof Error ? error.message : String(error);
          return { content: [{ type: "text", text: message }], isError: true };
        }
      },
    );
  • Helper/bridge function that wires the registered tool name (snake_case) to the actual handler (camelCase) with a bound client.
    get_categories: (params?: GetCategoriesParams) => getCategories(client, params),
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must disclose behavioral traits. It fails to mention whether the tool requires authentication, has rate limits, or returns paginated results. The description is too minimal for transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence, which is front-loaded. However, it is too brief and lacks structural elements like bullet points or additional context that would enhance usability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and no annotations, the description should clarify what 'top-level categories' includes, any limitations, or prerequisites. It is incomplete for an agent to fully understand the tool's behavior and output.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% (one parameter with description). The description adds no extra meaning beyond the schema's site_id description. Baseline 3 is appropriate as the schema does the work.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states it lists all top-level categories for a MercadoLibre site. It uses a specific verb ('list') and resource ('top-level categories'), and distinguishes from sibling tools like get_category which retrieves a single category.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not provide explicit guidance on when to use this tool versus alternatives. It is implied by the function (listing top-level categories), but there is no mention of exclusions or when to use get_category instead.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/dan1d/mercadolibre-mcp'

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