Skip to main content
Glama
snilld-ai

OpenAI Assistant MCP Server

by snilld-ai

update-assistant

Modify an existing OpenAI assistant's configuration, including its name, instructions, model, temperature, file attachments, and file search settings.

Instructions

Update an existing OpenAI assistant

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assistant_idYesThe ID of the assistant to update
nameNoThe new name of the assistant
instructionsNoThe new instructions for the assistant
modelNoThe new model for the assistant
temperatureNoThe new sampling temperature
file_idsNoThe new list of file IDs attached to the assistant
enable_file_searchNoEnable or disable the file search tool

Implementation Reference

  • Core implementation of the 'update-assistant' tool, calling OpenAI's beta.assistants.update API with processed arguments.
    async def update_assistant(self, assistant_id: str, **kwargs):
        try:
            # Filter out None values to avoid overwriting existing settings with defaults
            update_data = {k: v for k, v in kwargs.items() if v is not None}
            
            # Handle file_ids separately to fit the tool_resources structure
            if 'file_ids' in update_data:
                file_ids = update_data.pop('file_ids')
                if file_ids:
                    update_data['tool_resources'] = {'file_search': {'vector_store_ids': file_ids}}
                else: # To remove files
                    update_data['tool_resources'] = {}
    
            if not update_data:
                raise ValueError("No update data provided")
    
            response = await self.client.beta.assistants.update(assistant_id, **update_data)
            return response
        except Exception as e:
            logger.error(f"Failed to update assistant {assistant_id}: {str(e)}")
            raise
  • Dispatch handler in the MCP server that processes tool arguments (including file_search tools) and delegates to LLMConnector.update_assistant.
    elif name == "update-assistant":
        assistant_id = arguments.pop("assistant_id")
        
        update_kwargs = arguments.copy()
    
        if "enable_file_search" in update_kwargs:
            tools = []
            if update_kwargs.pop("enable_file_search"):
                tools.append({"type": "file_search"})
            update_kwargs["tools"] = tools
    
        response = await connector.update_assistant(assistant_id, **update_kwargs)
        return [types.TextContent(type="text", text=f"Assistant updated:\\n{response}")]
  • Input schema definition for the 'update-assistant' tool, defining parameters and validation.
    inputSchema={
        "type": "object",
        "properties": {
            "assistant_id": {"type": "string", "description": "The ID of the assistant to update"},
            "name": {"type": "string", "description": "The new name of the assistant"},
            "instructions": {"type": "string", "description": "The new instructions for the assistant"},
            "model": {"type": "string", "description": "The new model for the assistant"},
            "temperature": {"type": "number", "description": "The new sampling temperature"},
            "file_ids": {"type": "array", "items": {"type": "string"}, "description": "The new list of file IDs attached to the assistant"},
            "enable_file_search": {"type": "boolean", "description": "Enable or disable the file search tool"}
        },
        "required": ["assistant_id"]
    }
  • Registration of the 'update-assistant' tool within the MCP server's list_tools handler.
    types.Tool(
        name="update-assistant",
        description="Update an existing OpenAI assistant",
        inputSchema={
            "type": "object",
            "properties": {
                "assistant_id": {"type": "string", "description": "The ID of the assistant to update"},
                "name": {"type": "string", "description": "The new name of the assistant"},
                "instructions": {"type": "string", "description": "The new instructions for the assistant"},
                "model": {"type": "string", "description": "The new model for the assistant"},
                "temperature": {"type": "number", "description": "The new sampling temperature"},
                "file_ids": {"type": "array", "items": {"type": "string"}, "description": "The new list of file IDs attached to the assistant"},
                "enable_file_search": {"type": "boolean", "description": "Enable or disable the file search tool"}
            },
            "required": ["assistant_id"]
        }
    ),
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Update' implies a mutation operation, it doesn't describe what happens to unspecified fields (partial vs. complete updates), whether changes are reversible, permission requirements, rate limits, or error conditions. This leaves significant behavioral gaps for a mutation 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 a single, clear sentence that immediately communicates the tool's purpose without any unnecessary words. It's perfectly front-loaded and wastes no space on redundant information.

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

Completeness2/5

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

For a mutation tool with 7 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what the tool returns, error conditions, or behavioral constraints. The 100% schema coverage helps with parameters, but overall context for safe and effective use is lacking.

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

Parameters3/5

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

The schema description coverage is 100%, so all parameters are documented in the schema. The description adds no additional parameter information beyond what's in the schema properties. This meets the baseline expectation when schema coverage is complete.

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

Purpose4/5

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

The description clearly states the action ('Update') and resource ('an existing OpenAI assistant'), making the purpose immediately understandable. It distinguishes from siblings like 'create-assistant' and 'delete-assistant' by specifying it modifies existing assistants rather than creating new ones or deleting them.

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

Usage Guidelines3/5

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

The description implies usage when modifying an existing assistant, but doesn't explicitly state when to use this versus alternatives like 'create-assistant' or 'retrieve-assistant'. It mentions 'existing' which differentiates from creation, but lacks explicit guidance on prerequisites or exclusions.

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

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