Skip to main content
Glama
Mike25app

scaleforge-mcp-meta-ads

get_campaign

Retrieve a single Meta Ads campaign by its ID for deep inspection, including all default fields and any specified custom fields.

Instructions

Get a single campaign by ID. Returns all default fields plus anything in fields. Use this for deep inspection of one campaign.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
campaign_idYesMeta Campaign ID
fieldsNoOverride default field list

Implementation Reference

  • The actual handler for the 'get_campaign' tool. Makes a GET request to Meta Graph API using the campaign_id as the path, with optional fields parameter.
    handler: async (args) =>
      metaGet(`/${String(args.campaign_id)}`, {
        fields: args.fields ?? DEFAULT_CAMPAIGN_FIELDS,
      }),
  • Input schema for get_campaign: requires campaign_id (string), optional fields (string).
    inputSchema: {
      campaign_id: z.string().describe("Meta Campaign ID"),
      fields: z.string().optional().describe("Override default field list"),
    },
  • The tool definition object for 'get_campaign' in the campaignTools array, including name, description, inputSchema, and handler.
    {
      name: "get_campaign",
      description:
        "Get a single campaign by ID. Returns all default fields plus anything in `fields`. " +
        "Use this for deep inspection of one campaign.",
      inputSchema: {
        campaign_id: z.string().describe("Meta Campaign ID"),
        fields: z.string().optional().describe("Override default field list"),
      },
      handler: async (args) =>
        metaGet(`/${String(args.campaign_id)}`, {
          fields: args.fields ?? DEFAULT_CAMPAIGN_FIELDS,
        }),
    },
  • Default field list used by get_campaign (and other campaign tools) when no custom fields are specified.
    const DEFAULT_CAMPAIGN_FIELDS =
      "id,name,status,effective_status,objective,buying_type,daily_budget,lifetime_budget,bid_strategy,budget_remaining,special_ad_categories,start_time,stop_time,created_time,updated_time";
  • src/index.ts:65-90 (registration)
    Registration loop in the MCP server entrypoint that registers all tools (including 'get_campaign' from campaignTools) with the McpServer.
    for (const tool of allTools) {
      server.registerTool(
        tool.name,
        {
          description: tool.description,
          inputSchema: tool.inputSchema,
        },
        // The SDK's ToolCallback type infers the arg shape from inputSchema, but
        // our shared ToolDef uses a generic Record<string, unknown> signature for
        // portability. The cast here is intentional and isolated to the bridge.
        async (args: unknown) => {
          try {
            const result = await tool.handler(args as Record<string, unknown>);
            return {
              content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }],
            };
          } catch (err) {
            const message = err instanceof Error ? err.message : String(err);
            return {
              content: [{ type: "text" as const, text: `Error: ${message}` }],
              isError: true,
            };
          }
        },
      );
    }
Behavior3/5

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

No annotations provided, so description must cover behavior. It states returns default fields plus `fields` parameter. It does not mention idempotency, error handling, or authentication, which is acceptable for a simple read tool but leaves minor gaps.

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?

Two sentences: first states purpose, second adds capability and usage guidance. No unnecessary words; front-loaded.

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?

Adequately covers purpose, parameters, and usage guidance. No output schema, but the return format is implied. Could mention error handling but not critical for a simple GET-like tool.

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

Parameters4/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 'anything in `fields`', clarifying that arbitrary fields can be requested, which adds value beyond the schema's 'Override default field list'.

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 'Get a single campaign by ID', which is a specific verb+resource. It distinguishes from siblings like list_campaigns by focusing on a single campaign and deep inspection.

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

Usage Guidelines4/5

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

Explicitly says 'Use this for deep inspection of one campaign', implying it's for detailed view vs. list. Does not mention when not to use, but context is clear.

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

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