maasy_get_brand_context
Retrieve complete brand DNA including name, industry, tone, ideal customer profile, value proposition, assets, and references to ensure consistent, on-brand content generation.
Instructions
Full brand DNA: name, industry, tone, ICP, value prop, assets, references. Essential for on-brand generation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | No | Brand UUID |
Implementation Reference
- src/index.ts:76-81 (registration)Registration of the 'maasy_get_brand_context' tool on the MCP server with its description ('Full brand DNA...') and schema (optional project_id). The handler is delegated to toolHandler('get_brand_context').
server.tool( "maasy_get_brand_context", "Full brand DNA: name, industry, tone, ICP, value prop, assets, references. Essential for on-brand generation.", { project_id: z.string().optional().describe("Brand UUID") }, toolHandler("get_brand_context") ); - src/index.ts:79-79 (schema)Input schema for the tool: optional project_id (string) with description 'Brand UUID'.
{ project_id: z.string().optional().describe("Brand UUID") }, - src/index.ts:26-43 (handler)Generic toolHandler wrapper that delegates to callGateway(toolName, args). For 'maasy_get_brand_context', it calls callGateway('get_brand_context', args) which makes a POST to the Supabase mcp-gateway edge function.
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 sends a POST request to the configured gateway URL with the tool name and arguments. This is the actual network call that executes the tool logic server-side (the real 'get_brand_context' logic lives in the Supabase edge function, not in this codebase).
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; } - src/index.ts:369-379 (helper)The 'active-brand' resource also calls callGateway('get_brand_context') with the default project ID, reusing the same backend logic.
try { const ctx = await callGateway("get_brand_context", { project_id: DEFAULT_PROJECT_ID }); return { contents: [{ uri: uri.href, mimeType: "application/json", text: JSON.stringify(ctx, null, 2) }] }; } catch (e: unknown) { return { contents: [ { uri: uri.href, mimeType: "text/plain", text: `Error: ${e instanceof Error ? e.message : String(e)}` }, ], }; } });