Skip to main content
Glama
ekim197

Uber External Ads API MCP Server

by ekim197

update_campaign

Modify existing Uber advertising campaigns by updating campaign name, status, budget amount, or end time using the Uber External Ads API.

Instructions

Update an existing campaign

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ad_account_idYesThe ad account UUID
auth_tokenNoBearer token for authentication
campaign_dataYes
campaign_idYesThe campaign UUID

Implementation Reference

  • The core handler function for the 'update_campaign' tool. It validates inputs using Zod schemas, constructs the Uber Ads API PATCH URL, sends the request with axios, and returns the API response or handles errors.
    private async updateCampaign(args: any) {
      const authToken = this.getAuthToken(args.auth_token);
      const adAccountId = AdAccountIdSchema.parse(args.ad_account_id);
      const campaignId = CampaignIdSchema.parse(args.campaign_id);
      const campaignData = CampaignUpdateSchema.parse(args.campaign_data);
    
      const url = `${UBER_ADS_API_BASE_URL}/${adAccountId}/campaigns/${campaignId}`;
    
      try {
        const response = await axios.patch(url, campaignData, {
          headers: {
            'Authorization': `Bearer ${authToken}`,
            'Accept': 'application/json',
            'Content-Type': 'application/json',
          },
        });
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(response.data, null, 2),
            },
          ],
        };
      } catch (error) {
        return this.handleApiError(error);
      }
    }
  • Zod schema used for validating the campaign_data input parameter in the update_campaign handler.
    const CampaignUpdateSchema = z.object({
      name: z.string().min(1).optional(),
      status: z.enum(['ACTIVE', 'PAUSED']).optional(),
      budget_amount: z.number().positive().optional(),
      end_time: z.string().optional(),
    });
  • src/index.ts:271-317 (registration)
    Tool registration in the listTools response, defining the name, description, and inputSchema for MCP clients.
    {
      name: 'update_campaign',
      description: 'Update an existing campaign',
      inputSchema: {
        type: 'object',
        properties: {
          auth_token: {
            type: 'string',
            description: 'Bearer token for authentication',
          },
          ad_account_id: {
            type: 'string',
            description: 'The ad account UUID',
          },
          campaign_id: {
            type: 'string',
            description: 'The campaign UUID',
          },
          campaign_data: {
            type: 'object',
            properties: {
              name: {
                type: 'string',
                description: 'Campaign name',
              },
              status: {
                type: 'string',
                enum: ['ACTIVE', 'PAUSED'],
                description: 'Campaign status',
              },
              budget_amount: {
                type: 'number',
                minimum: 0.01,
                description: 'Budget amount in USD',
              },
              end_time: {
                type: 'string',
                description: 'Campaign end time (ISO 8601)',
              },
            },
            additionalProperties: false,
          },
        },
        required: ['ad_account_id', 'campaign_id', 'campaign_data'],
        additionalProperties: false,
      },
    },
  • src/index.ts:420-421 (registration)
    Dispatch case in the CallToolRequestSchema handler that routes 'update_campaign' calls to the updateCampaign method.
    case 'update_campaign':
      return await this.updateCampaign(args);
  • Zod schema for validating the campaign_id parameter.
    const CampaignIdSchema = z.string().min(1, 'Campaign ID is required');
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool updates campaigns, implying mutation, but fails to describe critical behaviors such as permission requirements, whether updates are reversible, error handling, or side effects. This leaves significant gaps for a mutation tool.

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 extremely concise with a single sentence that directly states the tool's purpose. There is no wasted language or unnecessary elaboration, making it front-loaded and efficient, though this conciseness comes at the cost of detail.

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?

For a mutation tool with no annotations and no output schema, the description is insufficient. It lacks information on behavioral traits, usage context, and output expectations, leaving the agent with incomplete guidance despite the decent schema coverage for inputs.

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 schema description coverage is 75%, with parameters like 'campaign_data' having nested properties documented. The description adds no additional parameter semantics beyond what the schema provides, but since the schema coverage is relatively high, a baseline score of 3 is appropriate as the schema does most of the work.

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

Purpose3/5

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

The description 'Update an existing campaign' clearly states the action (update) and resource (campaign), but it's vague about what aspects can be updated and doesn't distinguish this tool from its sibling 'create_campaign' beyond the basic verb difference. It provides minimal but adequate purpose information.

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 is provided on when to use this tool versus alternatives like 'create_campaign' or 'delete_campaign'. The description implies usage for modifying campaigns but offers no context about prerequisites, constraints, or typical scenarios for choosing this over other operations.

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/ekim197/HACKATHON_MCP'

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