Skip to main content
Glama

get_lead

Retrieve lead details by ID from Meta Ads campaigns. Provide the lead ID to access specific lead data.

Instructions

Get details of a specific lead by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lead_idYesLead ID
fieldsNoComma-separated fields to return

Implementation Reference

  • The get_lead tool is registered via server.tool() in registerLeadTools().
    // ─── get_lead ──────────────────────────────────────────────
    server.tool(
      "get_lead",
      "Get details of a specific lead by ID.",
      {
        lead_id: z.string().describe("Lead ID"),
        fields: z.string().optional().describe("Comma-separated fields to return"),
      },
      async ({ lead_id, ...params }) => {
        try {
          const { data, rateLimit } = await client.get(`/${lead_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 };
        }
      }
    );
  • The handler function that executes the tool logic — calls client.get() with the lead_id, returns JSON response with rate limit info.
      async ({ lead_id, ...params }) => {
        try {
          const { data, rateLimit } = await client.get(`/${lead_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 };
        }
      }
    );
  • Input schema for get_lead: requires lead_id (string), optional fields (string).
    {
      lead_id: z.string().describe("Lead ID"),
      fields: z.string().optional().describe("Comma-separated fields to return"),
    },
  • src/index.ts:68-68 (registration)
    The top-level registration call in the main server setup.
    registerLeadTools(server, client);
  • The AdsClient.get() method used by the handler to make the API request.
    async get(
      path: string,
      params?: Record<string, unknown>
    ): Promise<ClientResponse> {
      return this.request("GET", path, params);
    }
Behavior2/5

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

With no annotations, the description carries the full burden of disclosing behavior. It only says 'Get details', implying a read-only operation, but it does not mention authentication, rate limits, or any other behavioral traits. The description adds minimal value beyond the tool name.

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 very concise at 7 words, but it may be too brief, lacking essential context like usage guidelines and behavioral notes. While succinct, it sacrifices completeness for brevity.

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 low complexity (2 params, no output schema), the description is minimally complete: it explains the basic action. However, without annotations, it could benefit from mentioning that the tool is read-only or specifying the return format. The schema helps, but the description alone is barely adequate.

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%, and the description adds no extra meaning beyond what the input schema already provides. The description says 'by ID' and mentions 'details', but the schema already specifies lead_id and fields. Baseline of 3 is appropriate.

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 verb 'Get', the resource 'details of a specific lead', and the means 'by ID', distinguishing it from sibling tools like get_form_leads which retrieve multiple leads. It is specific and unambiguous.

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?

The description does not provide any guidance on when to use this tool versus alternatives such as get_form_leads or get_campaign_leads. It merely states what it does, leaving the agent to infer usage context.

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