Skip to main content
Glama

get_product

Retrieve details of a specific product by its ID. Specify fields to return only needed information.

Instructions

Get details of a specific product.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
product_idYesProduct ID
fieldsNoComma-separated fields to return

Implementation Reference

  • Registration of the 'get_product' tool via server.tool(), including its schema (product_id required, fields optional) and handler function.
    server.tool(
      "get_product",
      "Get details of a specific product.",
      {
        product_id: z.string().describe("Product ID"),
        fields: z.string().optional().describe("Comma-separated fields to return"),
      },
      async ({ product_id, ...params }) => {
        try {
          const { data, rateLimit } = await client.get(`/${product_id}`, { ...params });
          return { content: [{ type: "text" as const, text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] };
        } catch (error) {
          return { content: [{ type: "text" as const, text: `Failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true };
        }
      }
    );
  • Handler function that makes a GET request to `/${product_id}` via the AdsClient and returns the data as JSON.
      async ({ product_id, ...params }) => {
        try {
          const { data, rateLimit } = await client.get(`/${product_id}`, { ...params });
          return { content: [{ type: "text" as const, text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] };
        } catch (error) {
          return { content: [{ type: "text" as const, text: `Failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true };
        }
      }
    );
  • Zod schema defining the input parameters: product_id (required string) and fields (optional string).
    {
      product_id: z.string().describe("Product ID"),
      fields: z.string().optional().describe("Comma-separated fields to return"),
    },
  • The registration helper function that registers all catalog tools including 'get_product'.
    export function registerCatalogTools(server: McpServer, client: AdsClient): void {
      // ─── list_catalogs ─────────────────────────────────────────
Behavior2/5

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

No annotations provided; description is minimal and does not disclose any behavioral traits (e.g., error handling, success conditions, authorization needs). For a read operation, more context on scope of details would be helpful.

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

Conciseness4/5

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

Description is one sentence, no fluff. However, it could be slightly more informative without becoming verbose. Acceptable conciseness.

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?

No output schema, and description does not explain return values or possible errors. For a product detail query, the description is insufficiently complete.

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% with descriptions for both parameters. Description adds no extra meaning beyond what the schema provides, so baseline 3 is appropriate.

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

Purpose4/5

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

Description states verb 'Get' and resource 'details of a specific product', clearly distinguishing it from list_products. Could be more specific about what details are returned.

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

Usage Guidelines2/5

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

No guidance on when to use this tool vs alternatives like list_products or get_product_set. Context signals show many sibling tools, but description provides no differentiation criteria.

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/mikusnuz/meta-ads-mcp'

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