Skip to main content
Glama

create_canvas

Create an Instant Experience canvas on a Facebook Page by providing the page ID and a JSON array of body elements defining the layout.

Instructions

Create a new Instant Experience (Canvas) on a Facebook Page. Requires page_id and body_elements JSON array defining the canvas layout.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
page_idYesFacebook Page ID to create the canvas on
body_elementsYesJSON array of canvas body elements (buttons, carousels, photos, videos, text, etc.)
nameNoCanvas name

Implementation Reference

  • The create_canvas tool handler: registers an MCP tool that creates a new Instant Experience (Canvas) on a Facebook Page. Accepts page_id (required), body_elements (required JSON string), and name (optional). Makes a POST request to /{page_id}/canvases via the AdsClient.
    // ─── create_canvas ─────────────────────────────────────────
    server.tool(
      "create_canvas",
      "Create a new Instant Experience (Canvas) on a Facebook Page. Requires page_id and body_elements JSON array defining the canvas layout.",
      {
        page_id: z.string().describe("Facebook Page ID to create the canvas on"),
        body_elements: z.string().describe("JSON array of canvas body elements (buttons, carousels, photos, videos, text, etc.)"),
        name: z.string().optional().describe("Canvas name"),
      },
      async ({ page_id, body_elements, name }) => {
        try {
          const params: Record<string, unknown> = { body_elements };
          if (name) params.name = name;
          const { data, rateLimit } = await client.post(`/${page_id}/canvases`, 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 };
        }
      }
    );
  • Zod schema for create_canvas input validation: page_id (string, required), body_elements (string, required), name (string, optional).
    {
      page_id: z.string().describe("Facebook Page ID to create the canvas on"),
      body_elements: z.string().describe("JSON array of canvas body elements (buttons, carousels, photos, videos, text, etc.)"),
      name: z.string().optional().describe("Canvas name"),
    },
  • src/index.ts:58-58 (registration)
    Registration of the canvas tools (including create_canvas) via registerCanvasTools(server, client) in the main server setup.
    registerCanvasTools(server, client);
  • src/index.ts:136-136 (registration)
    Registration of canvas tools in the sandbox/test server setup.
    registerCanvasTools(sandbox, mockClient);
  • The registerCanvasTools export function that wraps all canvas tool registrations. Imported and called by src/index.ts.
    export function registerCanvasTools(server: McpServer, client: AdsClient): void {
Behavior2/5

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

No annotations are provided, and the description only states what the tool does (create) and required inputs. It does not disclose side effects, authentication needs, rate limits, or return behavior. For a mutation tool, this is insufficient transparency.

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 with no fluff. Purpose is front-loaded, and required elements are stated efficiently. Every word earns its place.

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?

The description covers purpose and required inputs but omits return value (e.g., created canvas ID) and any constraints like permissions. Given no output schema and simple params, it is moderately complete but could improve.

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% with descriptions for all parameters. The tool description reinforces required params and clarifies body_elements as defining layout, adding marginal value. Baseline per instructions is 3 due to high coverage.

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 'Create' and the resource 'Instant Experience (Canvas) on a Facebook Page'. It distinguishes from sibling tools like delete_canvas, get_canvas, and list_canvases by specifying the action and required fields.

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 usage by stating requirements (page_id, body_elements) but does not explicitly guide when to use this tool vs. alternatives or mention when not to use it. No guidance on prerequisites beyond required parameters.

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