retrieve-assistant
Retrieve an OpenAI assistant by its unique ID to access its configuration, capabilities, and settings for integration or management purposes.
Instructions
Retrieve an OpenAI assistant by ID
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assistant_id | Yes | The ID of the assistant to retrieve |
Implementation Reference
- src/mcp_server_openai/llm.py:34-40 (handler)Core handler implementation that retrieves the OpenAI assistant using the AsyncOpenAI client API.
async def retrieve_assistant(self, assistant_id: str): try: response = await self.client.beta.assistants.retrieve(assistant_id) return response except Exception as e: logger.error(f"Failed to retrieve assistant {assistant_id}: {str(e)}") raise - src/mcp_server_openai/server.py:152-157 (handler)Tool dispatch handler in the main call_tool function that validates input and delegates to LLMConnector.retrieve_assistant.
elif name == "retrieve-assistant": assistant_id = arguments.get("assistant_id") if not assistant_id: raise ValueError("assistant_id is required for retrieve-assistant") response = await connector.retrieve_assistant(assistant_id) return [types.TextContent(type="text", text=f"Assistant Details:\\n{response}")] - src/mcp_server_openai/server.py:46-56 (registration)Tool registration including name, description, and input schema in the list_tools handler.
types.Tool( name="retrieve-assistant", description="Retrieve an OpenAI assistant by ID", inputSchema={ "type": "object", "properties": { "assistant_id": {"type": "string", "description": "The ID of the assistant to retrieve"} }, "required": ["assistant_id"] } ), - Input schema definition for the retrieve-assistant tool, specifying required assistant_id.
inputSchema={ "type": "object", "properties": { "assistant_id": {"type": "string", "description": "The ID of the assistant to retrieve"} }, "required": ["assistant_id"] }