Skip to main content
Glama
dan1d

mercadolibre-mcp

get_category

Retrieve category details including name, hierarchical path from root, and list of subcategories for a given category ID.

Instructions

Get category details including name, path from root, and children categories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
category_idYesCategory ID (e.g. MLA1055)

Implementation Reference

  • The actual handler function for get_category. Makes a GET request to /categories/{category_id} via the MercadoLibreClient.
    export async function getCategory(
      client: MercadoLibreClient,
      params: GetCategoryParams
    ): Promise<unknown> {
      return client.get(`/categories/${encodeURIComponent(params.category_id)}`);
    }
  • Input parameter type definition for get_category. Defines the required category_id string field.
    export interface GetCategoryParams {
      category_id: string;
    }
  • MCP server registration of the 'get_category' tool with Zod schema for category_id and a handler that calls tools.get_category.
    server.tool(
      "get_category",
      "Get category details including name, path from root, and children categories.",
      {
        category_id: z.string().describe("Category ID (e.g. MLA1055)"),
      },
      async (params) => {
        try {
          const result = await tools.get_category(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 };
        }
      },
    );
  • Tool factory that wires get_category to the getCategory action with the client bound. Also re-exports getCategory and GetCategoryParams.
    export function createMercadoLibreTools(accessToken?: string) {
      const client = new MercadoLibreClient(accessToken);
    
      return {
        tools: {
          search_items: (params: SearchItemsParams) => searchItems(client, params),
          get_item: (params: GetItemParams) => getItem(client, params),
          get_item_description: (params: GetItemDescriptionParams) => getItemDescription(client, params),
          get_categories: (params?: GetCategoriesParams) => getCategories(client, params),
          get_category: (params: GetCategoryParams) => getCategory(client, params),
          get_seller_info: (params: GetSellerInfoParams) => getSellerInfo(client, params),
          get_trends: (params?: GetTrendsParams) => getTrends(client, params),
          get_currency_conversion: (params: GetCurrencyConversionParams) => getCurrencyConversion(client, params),
        },
      };
    }
Behavior2/5

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

No annotations provided. Description only states basic purpose and return fields, omitting any behavioral traits like read-only nature, required permissions, rate limits, or error conditions. Minimal transparency beyond the obvious.

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

Conciseness5/5

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

Single sentence, no redundancy. Every word adds value. Front-loaded with action and resource.

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

Completeness3/5

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

Given the simple tool (1 param, no output schema), the description lists three key return fields but does not cover potential errors, response structure, or any additional context like pagination. Adequate but leaves gaps for a comprehensive understanding.

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?

The single parameter is fully described in the input schema (100% coverage). The description does not add any meaning beyond the schema's 'Category ID (e.g. MLA1055)'. Baseline 3 applies due to high schema coverage.

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?

Clearly states the action 'get' and the resource 'category details', specifying key return fields (name, path from root, children). Differentiates from siblings like get_categories (which likely lists all categories) and get_item (item details).

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?

No explicit guidance on when to use this tool versus alternatives like get_categories or search_items. Usage context is implied through the description of what it returns, but no when-not-to-use or alternative mentions.

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