maasy_list_brands
List all brands or projects in your Maasy account with basic details to view and manage your marketing initiatives.
Instructions
List all brands (projects) in your maasy account with basic info
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:62-67 (registration)Registration of the 'maasy_list_brands' MCP tool. It has no input parameters (empty schema '{}') and delegates to toolHandler('list_brands'), which calls the gateway with the 'list_brands' tool name.
server.tool( "maasy_list_brands", "List all brands (projects) in your maasy account with basic info", {}, toolHandler("list_brands") ); - src/index.ts:26-43 (handler)Generic 'toolHandler' wrapper function that executes the actual tool logic. For 'maasy_list_brands', it calls callGateway('list_brands', args) which makes an HTTP POST to the MCP gateway edge function. The result is returned as JSON text content.
function toolHandler(toolName: string, argsFn?: (args: Record<string, unknown>) => Record<string, unknown>) { return async (args: Record<string, unknown>) => { try { const gatewayArgs = argsFn ? argsFn(args) : args; // Auto-inject default project_id if not provided if (DEFAULT_PROJECT_ID && !gatewayArgs.project_id) { gatewayArgs.project_id = DEFAULT_PROJECT_ID; } const result = await callGateway(toolName, gatewayArgs); return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] }; } catch (e: unknown) { return { content: [{ type: "text" as const, text: `Error: ${e instanceof Error ? e.message : String(e)}` }], isError: true, }; } }; } - src/supabase.ts:42-59 (helper)The 'callGateway' function in supabase.ts sends the tool name and args to the MCP gateway edge function via HTTP POST. For 'maasy_list_brands', it sends { tool: 'list_brands', args: {} } to the Supabase edge function endpoint.
export async function callGateway(tool: string, args: Record<string, unknown> = {}): Promise<unknown> { const res = await fetch(gatewayUrl, { method: "POST", headers: { "Content-Type": "application/json", [authHeader.name]: authHeader.value, }, body: JSON.stringify({ tool, args }), }); const data = await res.json(); if (!res.ok) { throw new Error(data.error || `Gateway error (${res.status})`); } return data.result; }