Skip to main content
Glama

execute_agent

Execute a Strands agent by providing an agent name and prompt, enabling integration with Amazon Q and MCP-compatible systems for task automation and workflow enhancement.

Instructions

Execute an agent with a given prompt

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_nameYesThe name of the agent to execute
promptYesThe prompt to execute the agent with

Implementation Reference

  • The execute_agent tool handler function. It is registered via the @mcp.tool decorator, with input schema defined using Annotated and Field for agent_name and prompt parameters. The function retrieves the agent from the registry, executes it with the prompt, and returns the result message as a string.
    @mcp.tool(description="Execute an agent with a given prompt") def execute_agent(agent_name: Annotated[str, Field(description="The name of the agent to execute")], prompt: Annotated[str, Field(description="The prompt to execute the agent with")]) -> str: """ Execute an agent with the provided name and prompt, return its response """ agent = agent_registry.get(agent_name) result = agent.agent(prompt) return str(result.message)

Other Tools

Related 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/imgaray/strands-agents-mcp'

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