listTextModels
Discover available text models on the MCPollinations Multimodal MCP Server to generate diverse AI-driven text outputs without authentication requirements.
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 the list of available text models from the Pollinations Text API endpoint and returns them in { models } format.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)Schema definition for the listTextModels tool, specifying its name, description, and empty input schema (no parameters required).export const listTextModelsSchema = { name: 'listTextModels', description: 'List available text models', inputSchema: { type: 'object', properties: {} } };
- src/schemas.js:32-44 (registration)The listTextModelsSchema is registered by being included in the array returned by getAllToolSchemas(), which is used by the MCP server to list available tools.export function getAllToolSchemas() { return [ generateImageUrlSchema, generateImageSchema, editImageSchema, generateImageFromReferenceSchema, listImageModelsSchema, respondAudioSchema, listAudioVoicesSchema, respondTextSchema, listTextModelsSchema ]; }
- pollinations-mcp-server.js:313-328 (handler)MCP server CallToolRequestSchema handler dispatches tool calls named 'listTextModels' by invoking listTextModels() and formatting the result as MCP content.} 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 }; }
- pollinations-mcp-server.js:198-200 (registration)MCP server registers all tools (including listTextModels via its schema) by setting the ListToolsRequestSchema handler to return getAllToolSchemas().server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: getAllToolSchemas() }));