get_creative
Retrieve details of a specific ad creative by its ID. Use this to access fields for ad creative analysis and management.
Instructions
Get details of a specific ad creative by ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| creative_id | Yes | Creative ID | |
| fields | No | Comma-separated fields to return |
Implementation Reference
- src/tools/creatives.ts:30-47 (handler)The handler function for the 'get_creative' tool. Calls the Meta Ads API with the creative_id to get details of a specific ad creative.
server.tool( "get_creative", "Get details of a specific ad creative by ID.", { creative_id: z.string().describe("Creative ID"), fields: z.string().optional().describe("Comma-separated fields to return"), }, async ({ creative_id, fields }) => { try { const params: Record<string, unknown> = {}; if (fields) params.fields = fields; const { data, rateLimit } = await client.get(`/${creative_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 }; } } ); - src/tools/creatives.ts:33-36 (schema)Input schema definition for 'get_creative': requires creative_id (string), optionally accepts fields (string).
{ creative_id: z.string().describe("Creative ID"), fields: z.string().optional().describe("Comma-separated fields to return"), }, - src/tools/creatives.ts:5-5 (registration)The registerCreativeTools function that registers the 'get_creative' tool (and siblings) on the MCP server.
export function registerCreativeTools(server: McpServer, client: AdsClient): void { - src/index.ts:53-53 (registration)Where registerCreativeTools is called to register the 'get_creative' tool on the main MCP server.
registerCreativeTools(server, client);