listTextModels
Retrieve a list of available text models from Pollinations to select the best one for your text generation tasks.
Instructions
List available text models
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/services/textService.js:80-99 (handler)The core handler function for listTextModels. It fetches available text models from the Pollinations API endpoint https://text.pollinations.ai/models and returns them as an object with a 'models' property.
/** * List available text generation models from Pollinations API * * @returns {Promise<Object>} - Object containing the list of available text models */ 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:43-53 (schema)The schema definition for the listTextModels tool. It defines the tool name as 'listTextModels', provides a description 'List available text models', and specifies an empty input schema (no parameters required).
/** * Schema for the listTextModels tool */ export const listTextModelsSchema = { name: 'listTextModels', description: 'List available text models', inputSchema: { type: 'object', properties: {} } }; - src/index.js:10-28 (registration)Import and re-export of listTextModels from the textService module, serving as the central client library entry point.
import { respondText, listTextModels } from './services/textService.js'; // Export all service functions export { // Image services generateImageUrl, generateImage, editImage, generateImageFromReference, listImageModels, // Audio services respondAudio, listAudioVoices, // Text services respondText, listTextModels,