Skip to main content
Glama
snilld-ai
by snilld-ai

retrieve-assistant

Retrieve an OpenAI assistant by its unique ID to access its configuration and capabilities for integration or management tasks.

Instructions

Retrieve an OpenAI assistant by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assistant_idYesThe ID of the assistant to retrieve

Implementation Reference

  • The tool handler logic for 'retrieve-assistant' in the @server.call_tool() function. It extracts the assistant_id, validates it, calls the LLMConnector helper, and formats the response.
    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}")]
  • Registration of the 'retrieve-assistant' tool in the @server.list_tools() function, including its description and input schema.
    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"] } ),
  • The core helper method in LLMConnector class that makes the OpenAI API call to retrieve the assistant by ID.
    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

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/snilld-ai/openai-assistant-mcp'

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