Skip to main content
Glama

listProducts

Retrieve a paginated list of products from the Omnisend catalog, enabling users to manage and access product data efficiently using limit and offset parameters.

Instructions

Retrieve a list of products from the Omnisend catalog with pagination support.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of products to return
offsetNoSkip first N results

Implementation Reference

  • MCP tool handler for 'listProducts'. Invokes the API function, filters product fields, serializes to JSON, and returns as text content in MCP format.
    async (args) => { try { const response = await listProducts(args); // Filter products data to include only defined fields const filteredProducts = response.products.map(filterProductFields); return { content: [ { type: "text", text: JSON.stringify({ products: filteredProducts, paging: response.paging }, 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" }] }; } }
  • JSON Schema defining the input parameters for the listProducts tool, supporting pagination and various filters.
    { additionalProperties: false, properties: { limit: { description: "Maximum number of products to return", type: "number" }, offset: { description: "Skip first N results", type: "number" }, status: { description: "Filter products by status", enum: ["active", "draft", "archived"], type: "string" }, vendor: { description: "Filter products by vendor/brand", type: "string" }, createdAfter: { description: "Filter products created after specified date (ISO format)", type: "string" }, updatedAfter: { description: "Filter products updated after specified date (ISO format)", type: "string" }, categories: { description: "Filter products by categories", items: { type: "string" }, type: "array" }, tags: { description: "Filter products by tags", items: { type: "string" }, type: "array" } }, type: "object" },
  • Full registration of the listProducts tool on the MCP server, including comment, name, description, schema, and handler.
    // List products tool server.tool( "listProducts", "Retrieve a list of products from the Omnisend catalog with pagination support. The response includes pagination information (next/previous cursor, limit, offset).", { additionalProperties: false, properties: { limit: { description: "Maximum number of products to return", type: "number" }, offset: { description: "Skip first N results", type: "number" }, status: { description: "Filter products by status", enum: ["active", "draft", "archived"], type: "string" }, vendor: { description: "Filter products by vendor/brand", type: "string" }, createdAfter: { description: "Filter products created after specified date (ISO format)", type: "string" }, updatedAfter: { description: "Filter products updated after specified date (ISO format)", type: "string" }, categories: { description: "Filter products by categories", items: { type: "string" }, type: "array" }, tags: { description: "Filter products by tags", items: { type: "string" }, type: "array" } }, type: "object" }, async (args) => { try { const response = await listProducts(args); // Filter products data to include only defined fields const filteredProducts = response.products.map(filterProductFields); return { content: [ { type: "text", text: JSON.stringify({ products: filteredProducts, paging: response.paging }, 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 performs the actual API call to list products from Omnisend using omnisendApi.get.
    // List products export const listProducts = async (params: ListProductsParams = {}): Promise<ProductsResponse> => { try { const response = await omnisendApi.get<ProductsResponse>('/products', { params }); return response.data; } catch (error) { if (error instanceof Error) { throw new Error(`Error getting products list: ${error.message}`); } else { throw new Error('Unknown error occurred when getting products list'); } } };
  • TypeScript interface defining parameters for the listProducts API helper function.
    export interface ListProductsParams { limit?: number; offset?: number; }

Other Tools

Related Tools

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