Skip to main content
Glama
ekim197

Uber External Ads API MCP Server

by ekim197

create_campaign

Create new advertising campaigns for Uber with configurable settings including budget, schedule, objectives, and status to manage ad promotions effectively.

Instructions

Create a new campaign

Input Schema

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

Implementation Reference

  • The primary handler function for the 'create_campaign' tool. It validates inputs using Zod schemas, constructs the API URL, sends a POST request to the Uber Ads API to create a campaign, and returns the response or handles errors.
    private async createCampaign(args: any) {
      const authToken = this.getAuthToken(args.auth_token);
      const adAccountId = AdAccountIdSchema.parse(args.ad_account_id);
      const campaignData = CampaignCreateSchema.parse(args.campaign_data);
    
      const url = `${UBER_ADS_API_BASE_URL}/${adAccountId}/campaigns`;
    
      try {
        const response = await axios.post(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 validation schema used in the createCampaign handler to parse and validate the campaign_data input.
    const CampaignCreateSchema = z.object({
      name: z.string().min(1, 'Campaign name is required'),
      status: z.enum(['ACTIVE', 'PAUSED']).default('ACTIVE'),
      budget_type: z.enum(['DAILY', 'LIFETIME']).default('DAILY'),
      budget_amount: z.number().positive('Budget amount must be positive'),
      start_time: z.string().optional(),
      end_time: z.string().optional(),
      objective: z.enum(['AWARENESS', 'CONSIDERATION', 'CONVERSION']).default('CONVERSION'),
    });
  • src/index.ts:211-270 (registration)
    Tool registration in the listTools response, including name, description, and detailed inputSchema matching the handler's expectations.
      name: 'create_campaign',
      description: 'Create a new 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_data: {
            type: 'object',
            properties: {
              name: {
                type: 'string',
                description: 'Campaign name',
              },
              status: {
                type: 'string',
                enum: ['ACTIVE', 'PAUSED'],
                default: 'ACTIVE',
                description: 'Campaign status',
              },
              budget_type: {
                type: 'string',
                enum: ['DAILY', 'LIFETIME'],
                default: 'DAILY',
                description: 'Budget type',
              },
              budget_amount: {
                type: 'number',
                minimum: 0.01,
                description: 'Budget amount in USD',
              },
              start_time: {
                type: 'string',
                description: 'Campaign start time (ISO 8601)',
              },
              end_time: {
                type: 'string',
                description: 'Campaign end time (ISO 8601)',
              },
              objective: {
                type: 'string',
                enum: ['AWARENESS', 'CONSIDERATION', 'CONVERSION'],
                default: 'CONVERSION',
                description: 'Campaign objective',
              },
            },
            required: ['name', 'budget_amount'],
            additionalProperties: false,
          },
        },
        required: ['ad_account_id', 'campaign_data'],
        additionalProperties: false,
      },
    },
  • src/index.ts:418-419 (registration)
    Dispatcher switch case in the CallToolRequestSchema handler that routes calls to the createCampaign method.
    case 'create_campaign':
      return await this.createCampaign(args);
Behavior1/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 but offers none. It doesn't indicate that this is a write operation (creating a resource), mention authentication requirements (though 'auth_token' is in the schema), discuss potential side effects (e.g., budget charges), rate limits, or what happens on success/failure. For a mutation tool with zero annotation coverage, this is critically inadequate.

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 at three words, with zero wasted language. It's front-loaded with the core action ('Create'), though this brevity comes at the cost of completeness. Every word earns its place by directly stating the tool's function, albeit minimally.

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

Completeness1/5

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

Given the tool's complexity (3 parameters with nested objects, no output schema, and no annotations), the description is severely incomplete. It doesn't address the mutation nature, authentication needs, parameter meanings, or expected outcomes. For a tool that creates resources with financial implications (budget), this lack of context is a major risk for correct agent usage.

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

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 67%, meaning some parameters are undocumented in the schema. The description adds no parameter semantics beyond what's in the schema—it doesn't explain the purpose of 'ad_account_id', 'auth_token', or 'campaign_data', nor does it clarify relationships between parameters (e.g., that 'campaign_data' contains nested fields). With low coverage and no compensation in the description, significant gaps remain.

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

Purpose2/5

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

The description 'Create a new campaign' is a tautology that merely restates the tool name 'create_campaign'. It lacks specificity about what a 'campaign' is in this context (e.g., advertising campaign) and doesn't distinguish this tool from its siblings like 'update_campaign' or 'delete_campaign' beyond the basic verb. No additional context about the resource type or domain is provided.

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

Usage Guidelines1/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an ad account), when not to use it (e.g., for modifying existing campaigns), or refer to sibling tools like 'update_campaign' or 'delete_campaign'. This leaves the agent with no contextual cues for tool selection.

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