Skip to main content
Glama
andybrandt

MCP Simple OpenAI Assistant

by andybrandt

Update OpenAI Assistant

update_assistant

Modify an existing assistant's configuration by updating its name, instructions, or AI model to adapt to changing requirements.

Instructions

Modify an existing assistant's name, instructions, or model used.

At least one optional parameter - what to change - must be provided, otherwise the tool will return an error. The ID required can be retrieved from the list_assistants tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assistant_idYes
nameNo
instructionsNo
modelNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The FastMCP tool handler for 'update_assistant', registered via @app.tool decorator. Performs initialization checks, input validation, delegates to AssistantManager.update_assistant, and formats the response.
    @app.tool(
        annotations={
            "title": "Update OpenAI Assistant",
            "readOnlyHint": False
        }
    )
    async def update_assistant(
        assistant_id: str,
        name: str = None,
        instructions: str = None,
        model: str = None
    ) -> str:
        """
        Modify an existing assistant's name, instructions, or model used.
        
        At least one optional parameter - what to change - must be provided, otherwise the tool will return an error.
        The ID required can be retrieved from the list_assistants tool.
        """
        if not manager:
            raise ToolError("AssistantManager not initialized.")
        if not any([name, instructions, model]):
            raise ToolError("You must provide at least one field to update (name, instructions, or model).")
        try:
            result = await manager.update_assistant(assistant_id, name, instructions, model)
            return f"Successfully updated assistant '{result.name}' (ID: {result.id})."
        except Exception as e:
            raise ToolError(f"Failed to update assistant {assistant_id}: {e}") 
  • Core helper function in AssistantManager that constructs update parameters from provided arguments and calls the OpenAI API to update the assistant.
    async def update_assistant(
        self,
        assistant_id: str,
        name: Optional[str] = None,
        instructions: Optional[str] = None,
        model: Optional[str] = None
    ) -> Assistant:
        """Update an existing assistant's configuration."""
        update_params = {}
        if name is not None:
            update_params["name"] = name
        if instructions is not None:
            update_params["instructions"] = instructions
        if model is not None:
            update_params["model"] = model
    
        return self.client.beta.assistants.update(
            assistant_id=assistant_id,
            **update_params
        )
  • Registration of the 'update_assistant' tool using FastMCP's @app.tool decorator with annotations.
    @app.tool(
        annotations={
            "title": "Update OpenAI Assistant",
            "readOnlyHint": False
        }
    )
    async def update_assistant(
        assistant_id: str,
        name: str = None,
        instructions: str = None,
        model: str = None
    ) -> str:
        """
        Modify an existing assistant's name, instructions, or model used.
        
        At least one optional parameter - what to change - must be provided, otherwise the tool will return an error.
        The ID required can be retrieved from the list_assistants tool.
        """
        if not manager:
            raise ToolError("AssistantManager not initialized.")
        if not any([name, instructions, model]):
            raise ToolError("You must provide at least one field to update (name, instructions, or model).")
        try:
            result = await manager.update_assistant(assistant_id, name, instructions, model)
            return f"Successfully updated assistant '{result.name}' (ID: {result.id})."
        except Exception as e:
            raise ToolError(f"Failed to update assistant {assistant_id}: {e}") 
Behavior3/5

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

Annotations indicate readOnlyHint=false (mutation), which aligns with 'Modify' in the description. The description adds behavioral context: at least one optional parameter must be provided to avoid errors, and ID sourcing from list_assistants. However, it lacks details on permissions, rate limits, or mutation effects beyond what annotations provide.

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 front-loaded with the core purpose, followed by critical constraints in two concise sentences. Every sentence adds essential information (modification scope, parameter requirement, ID sourcing) with zero waste.

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

Completeness4/5

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

Given a mutation tool with annotations (readOnlyHint=false), 4 parameters (0% schema coverage), and an output schema (reducing need to describe returns), the description covers purpose, constraints, and ID sourcing adequately. It could improve by detailing parameter semantics or error cases more fully.

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?

Schema description coverage is 0%, so the description must compensate. It mentions parameters (name, instructions, model) and their optional nature, but doesn't explain semantics like format constraints or model options. It adds some value over the bare schema but doesn't fully address the coverage gap.

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 ('Modify') and resource ('existing assistant'), specifying the updatable fields (name, instructions, model). It distinguishes from siblings like create_assistant (creation vs. modification) and retrieve_assistant (retrieval vs. update), though not explicitly naming alternatives.

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

Usage Guidelines4/5

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

The description provides clear context: use when modifying an assistant's attributes, with the ID obtainable from list_assistants. It implies usage vs. create_assistant (modify existing vs. create new) but doesn't explicitly state when not to use or compare to all siblings like update_thread.

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