list-assistants
Retrieve available OpenAI assistants to manage and select AI agents for specific tasks through the MCP server.
Instructions
List OpenAI assistants
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp_server_openai/server.py:38-45 (registration)Registration of the 'list-assistants' tool including its name, description, and input schema (empty properties).types.Tool( name="list-assistants", description="List OpenAI assistants", inputSchema={ "type": "object", "properties": {} } ),
- src/mcp_server_openai/server.py:145-150 (handler)Handler dispatch for 'list-assistants' tool: calls LLMConnector.list_assistants(), formats the list of assistants into a string, and returns as TextContent.elif name == "list-assistants": response = await connector.list_assistants() assistants_str = "\\n".join([f"- ID: {a.id}, Name: {a.name}, Model: {a.model}" for a in response]) if not assistants_str: assistants_str = "No assistants found." return [types.TextContent(type="text", text=f"Assistants:\\n{assistants_str}")]
- src/mcp_server_openai/llm.py:26-32 (handler)Core implementation of listing assistants: asynchronously calls OpenAI's beta.assistants.list() API and returns the data.async def list_assistants(self): try: response = await self.client.beta.assistants.list() return response.data except Exception as e: logger.error(f"Failed to list assistants: {str(e)}") raise