maasy_scan_brand
Scan brand health across DNA completeness, campaigns, content, CRM, SEO, and alerts. Receive traffic-light status for each area to quickly identify issues and optimize marketing.
Instructions
Deep health scan: DNA completeness, campaigns, content, CRM, SEO, alerts. Returns traffic-light status per area.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | No | Brand UUID (uses default if omitted) |
Implementation Reference
- src/index.ts:69-74 (registration)Registration of the 'maasy_scan_brand' MCP tool using server.tool(). It accepts an optional project_id and delegates to toolHandler('scan_brand').
server.tool( "maasy_scan_brand", "Deep health scan: DNA completeness, campaigns, content, CRM, SEO, alerts. Returns traffic-light status per area.", { project_id: z.string().optional().describe("Brand UUID (uses default if omitted)") }, toolHandler("scan_brand") ); - src/index.ts:26-43 (handler)Generic toolHandler wrapper that calls callGateway(toolName, gatewayArgs) on the Supabase edge function 'mcp-gateway'. This is the handler invoked when 'maasy_scan_brand' is called – it passes 'scan_brand' as the tool name.
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/index.ts:72-72 (schema)Input schema for maasy_scan_brand: optional project_id string validated by Zod.
{ project_id: z.string().optional().describe("Brand UUID (uses default if omitted)") }, - src/supabase.ts:42-59 (helper)The callGateway function that sends the tool name ('scan_brand') and args to the Supabase edge function gateway, which executes the actual brand scan logic server-side.
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; }