Skip to main content
Glama
dan1d

mercadolibre-mcp

get_trends

Fetch current trending searches on MercadoLibre for a specific site. Use this data to understand market demand and align product offerings.

Instructions

Get current trending searches on MercadoLibre for a specific site/country.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
site_idNoSite ID (default: MLA)

Implementation Reference

  • The actual handler function that executes the tool logic: calls client.get on /trends/{siteId} endpoint.
    export async function getTrends(
      client: MercadoLibreClient,
      params?: GetTrendsParams
    ): Promise<unknown> {
      const siteId = params?.site_id ?? "MLA";
      return client.get(`/trends/${encodeURIComponent(siteId)}`);
    }
  • Input schema/type definition for GetTrendsParams (optional site_id).
    export interface GetTrendsParams {
      site_id?: string;
    }
  • MCP server tool registration using server.tool() with name 'get_trends', description, Zod schema, and handler that calls tools.get_trends.
    server.tool(
      "get_trends",
      "Get current trending searches on MercadoLibre for a specific site/country.",
      {
        site_id: z.string().optional().describe("Site ID (default: MLA)"),
      },
      async (params) => {
        try {
          const result = await tools.get_trends(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/export that wraps getTrends with a bound client, exposed via createMercadoLibreTools().
    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),
        },
      };
Behavior3/5

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

With no annotations, the description carries full burden. It indicates a read-only operation for current data, but lacks details on data freshness, caching, or any side effects. It meets a minimal threshold but could be more transparent.

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?

The description is a single, concise sentence with no extraneous words. It efficiently conveys the tool's purpose and main input.

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

Completeness4/5

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

For a simple tool with one optional parameter and no output schema, the description adequately covers the purpose and primary input. It could mention the output format (e.g., list of trends) but is not critically incomplete.

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 only parameter, site_id, is described in the schema with default. The description adds the context of 'specific site/country', aligning with the schema. Since schema coverage is 100%, the description adds no significant extra meaning beyond reinforcing the scope.

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 clearly states the tool retrieves current trending searches on MercadoLibre for a specific site, with the verb 'Get' and resource 'trending searches'. It is distinct from sibling tools like get_categories or get_item, which deal with different data.

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 implies use when trending search data is needed for a site, but provides no explicit guidance on when to choose this tool over alternatives, nor any when-not-to-use conditions.

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