Skip to main content
Glama

listTextModels

Retrieve available text generation models for AI assistants to create content through the Pollinations API without authentication.

Instructions

List available text models

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that fetches and returns the list of available text models from the Pollinations Text API.
    export async function listTextModels() { try { const response = await fetch('https://text.pollinations.ai/models'); if (!response.ok) { throw new Error(`Failed to list text models: ${response.statusText}`); } const models = await response.json(); return { models }; } catch (error) { log('Error listing text models:', error); throw error; } }
  • Input/output schema definition for the listTextModels tool. No input parameters required.
    export const listTextModelsSchema = { name: 'listTextModels', description: 'List available text models', inputSchema: { type: 'object', properties: {} } };
  • Registers the tool schema by including it in the list of tools returned for ListToolsRequest.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: getAllToolSchemas() }));
  • Dispatch handler in MCP CallToolRequest that invokes the listTextModels function for this tool name.
    } else if (name === 'listTextModels') { try { const result = await listTextModels(); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error listing text models: ${error.message}` } ], isError: true }; }
  • src/schemas.js:42-42 (registration)
    Includes the listTextModelsSchema in the getAllToolSchemas() array used for tool listing.
    listTextModelsSchema

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/pinkpixel-dev/MCPollinations'

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