Adding an Agent as a Tool
Agents can be added to any MCP server you’ve created in your Glean instance. Follow these steps to expose an agent as an MCP tool:1
Navigate to the MCP admin page
In the Admin Console, go to Platform > Glean MCP servers to view your configured MCP servers.
2
Select or create a server
Choose an existing server or create a new one where you want to add the agent tool. Click on the server to view its configuration.
3
Add an agent as a tool
In the Available tools section, you’ll see both built-in Glean tools and your agents listed together. Agents appear below the built-in tools in the selection interface.
- Click or select the agent(s) you want to add from the available tools list
- The selected agents will be enabled as tools on this server

4
Verify the agent is enabled
The agent should now appear as an enabled tool, shown alongside the built-in tools in the “Available tools” section.
For end users: Direct your users to the Using the Glean MCP Server guide for complete setup instructions on connecting MCP host applications to your Glean instance and accessing agent tools.
Agent Constraints
Not all agents are eligible to be added as MCP tools. The following restrictions apply:These restrictions apply to the agent’s entire workflow, including any sub-agents. If your agent routes to a sub-agent that contains write actions or HITL steps, the parent agent also cannot be added to an MCP server.
Best Practices for Agents as Tools
Follow these best practices to ensure your agents work effectively as MCP tools:Write Meaningful Agent Descriptions
The agent’s description is critical for MCP hosts to understand when and how to use the tool. The description is used by the LLM in the host application to decide whether to invoke your agent.Good description examples
Good description examples
- “Search the company’s Jira issues and return structured information about bugs, features, and their status” - Specific, action-oriented, describes what data is returned
- “Analyze pull request code changes and provide feedback on code quality, potential bugs, and best practices” - Clear purpose, describes the analysis performed
- “Find employee information including role, team, location, and contact details from the HR system” - Explicit about data sources and types of information returned
Poor description examples
Poor description examples
- “Jira agent” - Too vague, doesn’t explain what the agent does
- “Helps with code” - Not specific enough for the LLM to know when to use it
- “Does stuff with employee data” - Unclear about what operations are performed or what data is returned
- Start with an action verb (e.g., “Search”, “Analyze”, “Find”, “Generate”)
- Specify the data sources the agent accesses
- Describe the type of output or information returned
- Keep it concise but informative (2-3 sentences maximum)
- Avoid jargon that might confuse the LLM’s tool selection logic
Design MCP-Compatible Agents
When creating agents specifically for MCP use, follow these design principles:- Focus on read-only operations - Agents should retrieve, analyze, and return information without modifying external systems
- Design autonomous workflows - Avoid “Wait for user input” steps; create workflows that complete without user confirmation or input
- Return actionable data - Instead of performing write operations, design agents to return recommendations or structured data that users can act upon in their MCP host application
Be Aware of MCP Host Timeouts
Different MCP host applications have different timeout values for tool invocations. If your agent takes too long to execute, the host may terminate the request before the agent completes. Timeout considerations:- Claude Desktop: ~60 seconds for tool calls
- Cursor: ~30-60 seconds depending on configuration
- VS Code with MCP: ~30 seconds default
- Other hosts: Vary widely, often 30-120 seconds
- Design agents to complete quickly (ideally under 30 seconds)
- If an agent needs to process large datasets, consider pagination or limiting result sets
- Use efficient search queries and avoid unnecessary processing steps
- Test your agent’s execution time before adding it to an MCP server
If an agent timeout occurs, the MCP host will typically show an error to the user. The agent execution on Glean’s side may continue, but the results won’t be returned to the host application.
Limit the Number of Tools per Server
Adding too many tools to a single MCP server can overwhelm both the server and the MCP host application’s LLM, leading to:- Poor tool selection by the host’s LLM
- Increased latency during tool enumeration
- Confusion about which tool to use for a given task
- Aim for 3-6 tools per server - This provides enough capabilities while keeping the tool set focused
- Group related tools together - Create separate servers for different use cases (e.g., “Engineering Context” server vs. “General Knowledge” server)
- Prefer quality over quantity - A small set of well-designed, high-signal agents is more valuable than many overlapping or low-quality agents
- Avoid duplicate functionality - If multiple agents perform similar tasks, choose the best one or consolidate them
Test Agent Performance as a Tool
Before widely deploying an agent as an MCP tool:- Test with multiple MCP hosts - Verify the agent works correctly in the host applications your users prefer
- Validate execution time - Ensure the agent completes within typical timeout windows
- Check error handling - Test how the agent behaves when searches return no results or when errors occur
- Review LLM tool selection - Confirm that the host’s LLM selects your agent tool appropriately based on user prompts
- Gather user feedback - Ask early users about the agent’s usefulness and any issues they encounter
Additional Resources
- Admin setup and host-specific guidance: Setting up Glean MCP Servers
- MCP server best practices: MCP Server Best Practices
- Claude MCP documentation: Build with Claude - Model Context Protocol
- Model Context Protocol documentation: https://modelcontextprotocol.io/