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
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "listTextModels"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/services/textService.js:77-96 (handler)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; } } - src/services/textService.js:146-146 (registration)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));