Skip to main content
Glama
lroolle

OpenAI Agents MCP Server

by lroolle

multi_tool_agent

Orchestrate AI agents to handle complex tasks by combining web search, file search, and computer actions based on your specific query requirements.

Instructions

Use an AI agent that can orchestrate between web search, file search, and computer actions based on your query.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
enable_computer_actionsNoWhether to enable computer action capabilities.
enable_file_searchNoWhether to enable file search capabilities.
enable_web_searchNoWhether to enable web search capabilities.
queryYesThe query or task you want help with.
vector_store_idsNoRequired if enable_file_search is True. The IDs of the vector stores to search in.

Implementation Reference

  • The complete handler function for the 'multi_tool_agent' MCP tool. It registers the tool via @mcp.tool decorator and implements the logic by constructing a multi-tool orchestrator agent that delegates to web search, file search, or computer action sub-agents based on enabled features and the user query.
    @mcp.tool(
        name="multi_tool_agent",
        description="Use an AI agent that can orchestrate between web search, file search, and computer actions based on your query.",
    )
    async def orchestrator_agent(
        query: str = Field(..., description="The query or task you want help with."),
        enable_web_search: bool = Field(True, description="Whether to enable web search capabilities."),
        enable_file_search: bool = Field(
            False, description="Whether to enable file search capabilities."
        ),
        enable_computer_actions: bool = Field(
            True, description="Whether to enable computer action capabilities."
        ),
        vector_store_ids: Optional[List[str]] = Field(
            None,
            description="Required if enable_file_search is True. The IDs of the vector stores to search in.",
        ),
    ) -> AgentResponse:
        """Use a specialized orchestrator agent that can delegate to the most appropriate specialized agent."""
        try:
            tools = []
    
            if enable_web_search:
                tools.append(
                    web_search_agent.as_tool(
                        tool_name="search_web", tool_description="Search the web for information"
                    )
                )
    
            if enable_file_search:
                if not vector_store_ids:
                    return AgentResponse(
                        response="Error: vector_store_ids is required when file search is enabled.",
                        raw_response=None,
                    )
    
                file_search_agent = Agent(
                    name="File Search Assistant",
                    instructions=file_search_instructions,
                    tools=[FileSearchTool(max_num_results=5, vector_store_ids=vector_store_ids)],
                )
    
                tools.append(
                    file_search_agent.as_tool(
                        tool_name="search_files",
                        tool_description="Search for information in files and documents",
                    )
                )
    
            if enable_computer_actions:
                computer = SimpleAsyncComputer()
    
                computer_action_agent = Agent(
                    name="Computer Action Assistant",
                    instructions=computer_action_instructions,
                    tools=[ComputerTool(computer=computer)],
                )
    
                tools.append(
                    computer_action_agent.as_tool(
                        tool_name="perform_computer_action",
                        tool_description="Perform an action on the computer",
                    )
                )
    
            orchestrator = Agent(
                name="Multi-Tool Orchestrator",
                instructions="""You are an intelligent orchestrator with access to specialized agents.
                Based on the user's query, determine which specialized agent(s) can best help and
                delegate the task to them.
    
                Guidelines:
                1. For queries about current events or facts, use the web search agent
                2. For queries about documents or specific files, use the file search agent
                3. For requests to perform actions on the computer, use the computer action agent
                4. For complex requests, you can use multiple agents in sequence
                5. Always explain your reasoning and which agent(s) you're using
                """,
                tools=tools,
            )
    
            with trace("Orchestrator agent execution"):
                result = await Runner.run(orchestrator, query)
    
            return AgentResponse(
                response=result.final_output,
                raw_response={"items": [str(item) for item in result.new_items]},
            )
    
        except Exception as e:
            print(f"Error running orchestrator agent: {e}")
            return AgentResponse(
                response=f"An error occurred while processing your request: {str(e)}", raw_response=None
            )
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool orchestrates between capabilities but doesn't describe how the orchestration works, what the agent does (e.g., sequential vs. parallel execution), error handling, or output format. This leaves significant gaps in understanding the tool's behavior beyond basic functionality.

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

Conciseness4/5

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

The description is a single, efficient sentence that front-loads the core purpose. It avoids unnecessary words and gets straight to the point, though it could be slightly more informative without sacrificing brevity.

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?

Given the tool's complexity (orchestrating multiple capabilities) and lack of annotations and output schema, the description is insufficient. It doesn't explain the orchestration logic, result aggregation, or any behavioral nuances, leaving the agent with incomplete context for effective use.

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 100%, so the schema fully documents all 5 parameters. The description doesn't add any parameter-specific information beyond what's in the schema (e.g., it doesn't explain how 'query' interacts with enabled capabilities or provide examples). Baseline score of 3 is appropriate as the schema handles parameter semantics adequately.

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 tool's purpose: 'Use an AI agent that can orchestrate between web search, file search, and computer actions based on your query.' It specifies the verb ('orchestrate') and resources (web search, file search, computer actions), but doesn't explicitly differentiate from sibling tools like computer_action_agent, file_search_agent, and web_search_agent, which are mentioned as siblings but not contrasted in the description.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus its sibling tools (computer_action_agent, file_search_agent, web_search_agent). It mentions the tool can orchestrate between capabilities but doesn't specify scenarios, prerequisites, or exclusions for choosing this multi-tool agent over individual specialized agents.

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/lroolle/openai-agents-mcp-server'

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