Skip to main content
Glama
andybrandt

MCP Simple OpenAI Assistant

by andybrandt

List OpenAI Assistants

list_assistants
Read-only

Retrieve available OpenAI assistants with IDs and configurations to select one for use in conversation threads without creating new ones.

Instructions

List all available OpenAI assistants associated with the API key configured by the user.

Returns a list of assistants with their IDs, names, and configurations. This can be used to select an assistant to use in the ask_assistant_in_thread tool instead of creating a new one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The @app.tool decorated handler function that implements the list_assistants tool logic. It calls the AssistantManager's list_assistants method and formats the output as a string.
        annotations={
            "title": "List OpenAI Assistants",
            "readOnlyHint": True
        }
    )
    async def list_assistants(limit: int = 20) -> str:
        """
        List all available OpenAI assistants associated with the API key configured by the user.
        
        Returns a list of assistants with their IDs, names, and configurations. This can be used to select 
        an assistant to use in the ask_assistant_in_thread tool instead of creating a new one.
        """
        if not manager:
            raise ToolError("AssistantManager not initialized.")
        try:
            assistants = await manager.list_assistants(limit)
            if not assistants:
                return "No assistants found."
    
            assistant_list = [
                dedent(f"""
                ID: {a.id}
                Name: {a.name}
                Model: {a.model}""")
                for a in assistants
            ]
            return "Available Assistants:\\n\\n" + "\\n---\\n".join(assistant_list)
        except Exception as e:
            raise ToolError(f"Failed to list assistants: {e}")
  • The supporting method in AssistantManager class that interacts with the OpenAI API to retrieve the list of assistants.
    async def list_assistants(self, limit: int = 20) -> list[Assistant]:
        """List available OpenAI assistants."""
        response = self.client.beta.assistants.list(limit=limit)
        return response.data
  • The @app.tool decorator registers the list_assistants function as an MCP tool with title and read-only hint.
        annotations={
            "title": "List OpenAI Assistants",
            "readOnlyHint": True
        }
    )
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, so the agent knows this is a safe read operation. The description adds useful context beyond annotations by specifying the return format ('list of assistants with their IDs, names, and configurations') and implying it's a listing operation with no destructive effects. However, it doesn't mention behavioral aspects like pagination, rate limits, or authentication requirements, which could be relevant for an API tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured in two sentences: the first states the purpose and return value, the second provides usage guidance. Every sentence adds value without redundancy, and it's front-loaded with the core functionality. No extraneous information is included.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (1 optional parameter), rich annotations (readOnlyHint), and the presence of an output schema (which handles return values), the description is complete enough. It covers purpose, usage context, and return format, addressing the key needs for a list operation without over-explaining what's already structured.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 1 parameter with 0% description coverage (no schema descriptions), so the description carries the full burden. It doesn't explicitly mention the 'limit' parameter or its semantics, which is a gap. However, with only 1 parameter and a default value provided in the schema, the baseline is high. The description compensates somewhat by implying listing behavior, but doesn't fully explain parameter usage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('List all available OpenAI assistants') and resource ('associated with the API key configured by the user'), distinguishing it from siblings like 'retrieve_assistant' (which gets one) and 'create_assistant' (which makes a new one). It explicitly mentions what information is returned ('IDs, names, and configurations'), making the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool: 'This can be used to select an assistant to use in the ask_assistant_in_thread tool instead of creating a new one.' It names a specific alternative ('ask_assistant_in_thread') and clarifies the context (selection vs. creation), offering clear usage differentiation from siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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