Skip to main content
Glama
andybrandt

MCP Simple OpenAI Assistant

by andybrandt

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
NameRequiredDescriptionDefault
assistant_idYes

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)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/andybrandt/mcp-simple-openai-assistant'

If you have feedback or need assistance with the MCP directory API, please join our Discord server