Skip to main content
Glama

getCurrentBrand

Retrieve current brand details from Omnisend, including ID, website, platform, currency, and configuration data for marketing operations.

Instructions

Retrieve information about the current brand from Omnisend. This includes brand ID, website, platform, version, currency, and other brand-related details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler function that executes the logic for 'getCurrentBrand': fetches the current brand via API, filters fields, formats as JSON text, and handles errors.
    async () => { try { const response = await getCurrentBrand(); // Filter brand data to include only defined fields const filteredBrand = filterBrandFields(response); return { content: [ { type: "text", text: JSON.stringify(filteredBrand, null, 2) } ] }; } catch (error) { if (error instanceof Error) { return { content: [{ type: "text", text: `Error: ${error.message}` }] }; } return { content: [{ type: "text", text: "An unknown error occurred" }] }; } } );
  • TypeScript interface definition for Brand, defining the structure of the brand data returned by the tool.
    export interface Brand { brandID: string; website?: string; platform?: string; version?: string; currency?: string; createdAt?: string; updatedAt?: string; [key: string]: unknown; }
  • Registration of the 'getCurrentBrand' tool on the MCP server, including name, description, input schema, and handler.
    export const registerBrandsTools = (server: McpServer) => { // Get current brand tool server.tool( "getCurrentBrand", "Retrieve information about the current brand from Omnisend. This includes brand ID, website, platform, version, currency, and other brand-related details.", { additionalProperties: false, properties: {}, type: "object" }, async () => { try { const response = await getCurrentBrand(); // Filter brand data to include only defined fields const filteredBrand = filterBrandFields(response); return { content: [ { type: "text", text: JSON.stringify(filteredBrand, null, 2) } ] }; } catch (error) { if (error instanceof Error) { return { content: [{ type: "text", text: `Error: ${error.message}` }] }; } return { content: [{ type: "text", text: "An unknown error occurred" }] }; } } ); };
  • Helper function that makes the API call to retrieve the current brand data from Omnisend.
    // Get current brand information export const getCurrentBrand = async (): Promise<Brand> => { try { const response = await omnisendApi.get<Brand>('/brands/current'); return response.data; } catch (error) { if (error instanceof Error) { throw new Error(`Error getting current brand information: ${error.message}`); } else { throw new Error('Unknown error occurred when getting current brand'); } } };
  • Helper function to filter brand data to only include relevant fields matching the Brand interface.
    export const filterBrandFields = (brand: any) => { return { brandID: brand.brandID, website: brand.website, platform: brand.platform, version: brand.version, currency: brand.currency, createdAt: brand.createdAt, updatedAt: brand.updatedAt }; };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/plutzilla/omnisend-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server