retrieve_assistant
Retrieve detailed information about a specific OpenAI assistant using its unique ID. Access assistant configurations, capabilities, and settings for integration or management purposes.
Instructions
Get detailed information about a specific assistant. The ID required can be retrieved from the list_assistants tool.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assistant_id | Yes |
Implementation Reference
- MCP tool handler and registration for 'retrieve_assistant'. Calls AssistantManager to fetch assistant details from OpenAI and returns formatted string output.@app.tool( annotations={ "title": "Retrieve OpenAI Assistant", "readOnlyHint": True } ) async def retrieve_assistant(assistant_id: str) -> str: """Get detailed information about a specific assistant. The ID required can be retrieved from the list_assistants tool.""" if not manager: raise ToolError("AssistantManager not initialized.") try: result = await manager.retrieve_assistant(assistant_id) return dedent(f""" Assistant Details: ID: {result.id} Name: {result.name} Model: {result.model} Instructions: {result.instructions} """) except Exception as e: raise ToolError(f"Failed to retrieve assistant {assistant_id}: {e}")
- Core helper method in AssistantManager that directly calls the OpenAI API to retrieve the Assistant object by ID.async def retrieve_assistant(self, assistant_id: str) -> Assistant: """Get details about a specific assistant.""" return self.client.beta.assistants.retrieve(assistant_id)