list_orgs
Retrieve all Apple Search Ads organizations accessible with your credentials. Verify authentication and obtain org IDs, names, currencies, timezones, payment models, and user roles.
Instructions
List all Apple Search Ads organizations accessible with the configured credentials. Requires ASA authentication. Use this to verify credentials are valid and to discover available org IDs before calling other tools. Returns org ID, name, currency, timezone, payment model, and assigned role names.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/orgs.ts:5-34 (handler)Registration and handler for the list_orgs tool. Calls the ASA API /acls endpoint to list all accessible organizations, mapping the response to orgId, orgName, currency, paymentModel, timeZone, and roleNames. No input parameters required (empty schema).
/** Registers the list_orgs tool — lists all accessible ASA organizations. */ export function registerOrgsTools(server: McpServer, client: AsaClient): void { server.tool( "list_orgs", "List all Apple Search Ads organizations accessible with the configured credentials. Requires ASA authentication. Use this to verify credentials are valid and to discover available org IDs before calling other tools. Returns org ID, name, currency, timezone, payment model, and assigned role names.", {}, async () => { const response = await client.get<Organization[]>("/acls"); const orgs = Array.isArray(response.data) ? response.data : []; const result = orgs.map((org) => ({ orgId: org.orgId, orgName: org.orgName, currency: org.currency, paymentModel: org.paymentModel, timeZone: org.timeZone, roleNames: org.roleNames, })); return { content: [ { type: "text" as const, text: JSON.stringify(result, null, 2), }, ], }; } ); - src/tools/orgs.ts:10-10 (schema)Input schema for list_orgs — an empty object ({}) since no parameters are needed.
{}, - src/server.ts:23-24 (registration)Registration call: registerOrgsTools(server, client) is invoked during server creation to wire up the list_orgs tool.
registerHealthTool(server); registerOrgsTools(server, client); - src/asa/types.ts:21-28 (helper)Organization TypeScript interface defining the shape of an organization object returned by the ASA API (orgId, orgName, currency, paymentModel, roleNames, timeZone).
export interface Organization { orgId: number; orgName: string; currency: string; paymentModel: string; roleNames: string[]; timeZone: string; }