update_creative
Modify the name and URL tags of an existing ad creative, as only these fields can be updated after creation.
Instructions
Update an existing ad creative. Only name and url_tags can be modified after creation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| creative_id | Yes | Creative ID to update | |
| name | No | New creative name | |
| url_tags | No | New URL tags |
Implementation Reference
- src/tools/creatives.ts:72-92 (registration)Registration of the 'update_creative' MCP tool via server.tool(), including its schema (creative_id required, name and url_tags optional) and handler function.
// ─── update_creative ─────────────────────────────────────── server.tool( "update_creative", "Update an existing ad creative. Only name and url_tags can be modified after creation.", { creative_id: z.string().describe("Creative ID to update"), name: z.string().optional().describe("New creative name"), url_tags: z.string().optional().describe("New URL tags"), }, async ({ creative_id, name, url_tags }) => { try { const params: Record<string, unknown> = {}; if (name) params.name = name; if (url_tags) params.url_tags = url_tags; const { data, rateLimit } = await client.post(`/${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:81-91 (handler)Handler function for update_creative. Takes creative_id, name, url_tags; builds params and sends POST request to /{creative_id} via the AdsClient. Returns JSON result or error.
async ({ creative_id, name, url_tags }) => { try { const params: Record<string, unknown> = {}; if (name) params.name = name; if (url_tags) params.url_tags = url_tags; const { data, rateLimit } = await client.post(`/${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:76-80 (schema)Input schema for update_creative using Zod: creative_id (string, required), name (string, optional), url_tags (string, optional). Description states only name and url_tags can be modified after creation.
{ creative_id: z.string().describe("Creative ID to update"), name: z.string().optional().describe("New creative name"), url_tags: z.string().optional().describe("New URL tags"), }, - src/services/ads-client.ts:187-191 (helper)The AdsClient.post() helper method used by the update_creative handler to send the POST request.
async post( path: string, params?: Record<string, unknown> ): Promise<ClientResponse> { return this.request("POST", path, params); - src/index.ts:53-53 (registration)Registration call in index.ts that wires up registerCreativeTools (which includes update_creative) during server initialization.
registerCreativeTools(server, client);