Skip to main content
Glama

delete_budget_schedule

Remove a budget schedule permanently. This action cannot be undone.

Instructions

Delete a budget schedule. This action is irreversible.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schedule_idYesBudget schedule ID to delete

Implementation Reference

  • The handler function for the 'delete_budget_schedule' tool. Takes a schedule_id parameter, sends a DELETE request to the Meta Ads API via client.delete(`/${schedule_id}`), and returns a success response. The tool description is 'Delete a budget schedule. This action is irreversible.'
    // ─── delete_budget_schedule ───────────────────────────────────
    server.tool(
      "delete_budget_schedule",
      "Delete a budget schedule. This action is irreversible.",
      {
        schedule_id: z.string().describe("Budget schedule ID to delete"),
      },
      async ({ schedule_id }) => {
        try {
          const { data, rateLimit } = await client.delete(`/${schedule_id}`);
          return { content: [{ type: "text" as const, text: JSON.stringify({ success: true, ...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 'delete_budget_schedule' — requires a single 'schedule_id' string parameter describing the budget schedule ID to delete.
    {
      schedule_id: z.string().describe("Budget schedule ID to delete"),
  • Registration of the 'delete_budget_schedule' tool via server.tool() with the name 'delete_budget_schedule' inside the registerBudgetTools function.
    server.tool(
      "delete_budget_schedule",
      "Delete a budget schedule. This action is irreversible.",
  • The AdsClient.delete() helper method used by the handler. Delegates to the internal request() method with method 'DELETE', appending parameters as query string.
    async delete(
      path: string,
      params?: Record<string, unknown>
    ): Promise<ClientResponse> {
      return this.request("DELETE", path, params);
    }
  • The registerBudgetTools function that registers all budget tools (including delete_budget_schedule) on the MCP server. Called from src/index.ts at line 82.
    export function registerBudgetTools(server: McpServer, client: AdsClient): void {
      // ─── list_budget_schedules ────────────────────────────────────
      server.tool(
        "list_budget_schedules",
        "List ad budget schedules for the ad account. Returns paginated results.",
        {
          fields: z.string().optional().describe("Comma-separated fields to return"),
          limit: z.number().optional().default(25).describe("Number of results (default 25)"),
          after: z.string().optional().describe("Pagination cursor for next page"),
        },
        async ({ fields, limit, after }) => {
          try {
            const params: Record<string, unknown> = {};
            if (fields) params.fields = fields;
            if (limit) params.limit = limit;
            if (after) params.after = after;
            const { data, rateLimit } = await client.get(`${client.accountPath}/adbudgetschedules`, 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 };
          }
        }
      );
    
      // ─── create_budget_schedule ───────────────────────────────────
      server.tool(
        "create_budget_schedule",
        "Create a new ad budget schedule for the ad account.",
        {
          budget_value: z.string().describe("Budget amount in account currency cents"),
          budget_value_type: z.string().describe("Budget value type (e.g. ABSOLUTE, MULTIPLIER)"),
          time_start: z.string().describe("Schedule start time (ISO 8601 or Unix timestamp)"),
          time_end: z.string().describe("Schedule end time (ISO 8601 or Unix timestamp)"),
        },
        async ({ budget_value, budget_value_type, time_start, time_end }) => {
          try {
            const params: Record<string, unknown> = {
              budget_value,
              budget_value_type,
              time_start,
              time_end,
            };
            const { data, rateLimit } = await client.post(`${client.accountPath}/adbudgetschedules`, 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 };
          }
        }
      );
    
      // ─── update_budget_schedule ───────────────────────────────────
      server.tool(
        "update_budget_schedule",
        "Update an existing budget schedule. Only provided fields will be modified.",
        {
          schedule_id: z.string().describe("Budget schedule ID to update"),
          budget_value: z.string().optional().describe("New budget amount in account currency cents"),
          time_start: z.string().optional().describe("New schedule start time"),
          time_end: z.string().optional().describe("New schedule end time"),
        },
        async ({ schedule_id, budget_value, time_start, time_end }) => {
          try {
            const params: Record<string, unknown> = {};
            if (budget_value) params.budget_value = budget_value;
            if (time_start) params.time_start = time_start;
            if (time_end) params.time_end = time_end;
            const { data, rateLimit } = await client.post(`/${schedule_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 };
          }
        }
      );
    
      // ─── delete_budget_schedule ───────────────────────────────────
      server.tool(
        "delete_budget_schedule",
        "Delete a budget schedule. This action is irreversible.",
        {
          schedule_id: z.string().describe("Budget schedule ID to delete"),
        },
        async ({ schedule_id }) => {
          try {
            const { data, rateLimit } = await client.delete(`/${schedule_id}`);
            return { content: [{ type: "text" as const, text: JSON.stringify({ success: true, ...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 };
          }
        }
      );
    }
Behavior2/5

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

The only behavioral trait disclosed is irreversibility. With no annotations, the description should provide more context (e.g., permissions needed, side effects, confirmation steps). It falls short.

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 short, relevant sentences with no fluff. Every word earns its place.

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?

For a simple deletion tool with one parameter and no output schema, the description is largely complete. It could mention expected return behavior (e.g., success confirmation), but the core intent is clear.

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 schema already describes the schedule_id parameter. The description adds no additional meaning beyond what is in the schema, so baseline 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 action (delete) and the resource (budget schedule). It distinguishes from sibling delete tools by specifying the resource type, and the irreversibility note adds clarity.

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

Usage Guidelines3/5

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

The description implies cautious use by stating 'This action is irreversible', but it does not provide explicit guidance on when to use this tool versus alternatives, nor does it mention prerequisites or exclusions.

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