Skip to main content
Glama

listTextModels

Discover available text generation models to select the right one for your content creation needs within the Pollinations multimodal toolkit.

Instructions

List available text models

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'listTextModels' tool. It fetches the list of available text models from the Pollinations Text API at '/models' endpoint, parses the JSON response, and returns it formatted as an MCP response using createMCPResponse and createTextContent.
    async function listTextModels(params) { try { const url = buildUrl(TEXT_API_BASE_URL, "models"); const response = await fetch(url); if (!response.ok) { throw new Error( `Failed to list text models: ${response.statusText}`, ); } const models = await response.json(); // Return the response in MCP format return createMCPResponse([createTextContent({ models }, true)]); } catch (error) { console.error("Error listing text models:", error); throw error; } }
  • The registration definition for the 'listTextModels' tool within the textTools export array. It specifies the tool name, description, empty input schema ({}), and references the handler function. This array is imported and spread into toolDefinitions, then registered via server.tool() in src/index.js.
    ["listTextModels", "List available text models", {}, listTextModels],
  • src/index.js:87-87 (registration)
    The MCP server tool registration loop that applies server.tool() to each tool definition in toolDefinitions, which includes the 'listTextModels' tool via spread from textTools.
    toolDefinitions.forEach((tool) => server.tool(...tool));

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/tusharpatil2912/pollinations-mcp'

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