get_adset
Retrieve a specific ad set by its ID from Meta Ads, returning default fields and any additional fields you specify.
Instructions
Get a single ad set by ID. Returns default fields plus anything in fields.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| adset_id | Yes | ||
| fields | No |
Implementation Reference
- src/tools/adsets.ts:83-86 (handler)Handler for the 'get_adset' tool. Makes a GET request to Meta Graph API with the adset_id and optional fields, returning the ad set data.
handler: async (args) => metaGet(`/${String(args.adset_id)}`, { fields: args.fields ?? DEFAULT_ADSET_FIELDS, }), - src/tools/adsets.ts:79-82 (schema)Input schema for get_adset: requires adset_id (string) and optional fields (string).
inputSchema: { adset_id: z.string(), fields: z.string().optional(), }, - src/index.ts:65-66 (registration)Registration of all tools via server.registerTool() loop. get_adset is registered here as part of the adsetTools array spread on line 50.
for (const tool of allTools) { server.registerTool( - src/index.ts:47-51 (registration)Collection of all tool definitions; adsetTools (which contains get_adset) is spread into the allTools array on line 50.
const allTools: ToolDef[] = [ ...accountTools, ...campaignTools, ...adsetTools, ...adTools, - src/tools/adsets.ts:76-87 (helper)Tool definition object for 'get_adset' with name, description, inputSchema, and handler. The handler calls metaGet() with the adset ID.
name: "get_adset", description: "Get a single ad set by ID. Returns default fields plus anything in `fields`.", inputSchema: { adset_id: z.string(), fields: z.string().optional(), }, handler: async (args) => metaGet(`/${String(args.adset_id)}`, { fields: args.fields ?? DEFAULT_ADSET_FIELDS, }), },