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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/services/textService.js:85-99 (handler)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; } }
- src/services/textSchema.js:46-53 (schema)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: {} } };
- pollinations-mcp-server.js:198-200 (registration)Registers the tool schema by including it in the list of tools returned for ListToolsRequest.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: getAllToolSchemas() }));
- pollinations-mcp-server.js:313-328 (registration)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