一键导入
agent-tools
Create and use tools with orxhestra agents. Covers function_tool, AgentTool, transfer tools, exit_loop, MCP tools, and CallContext.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create and use tools with orxhestra agents. Covers function_tool, AgentTool, transfer tools, exit_loop, MCP tools, and CallContext.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Build orxhestra agent trees from declarative YAML orx files. Covers full schema, models, tools, agents, runner, and server.
Expose orxhestra agents as A2A protocol endpoints or connect to remote A2A agents.
Add callbacks to orxhestra agents for logging, monitoring, and error handling. Covers model and tool callbacks.
Add planners to orxhestra agents for structured reasoning. Covers BasePlanner, PlanReActPlanner, and TaskPlanner.
Add dynamic skills to orxhestra agents. Covers Skill, InMemorySkillStore, and skill discovery/loading tools.
Stream events from orxhestra agents including token-by-token output, sub-agent events via AgentTool, and Runner streaming.
| name | agent-tools |
| description | Create and use tools with orxhestra agents. Covers function_tool, AgentTool, transfer tools, exit_loop, MCP tools, and CallContext. |
from orxhestra.tools import function_tool
@function_tool
async def search_web(query: str) -> str:
"""Search the web for information."""
return f"Results for: {query}"
# Or with custom name
@function_tool(name="web_search", description="Search the internet")
async def search(query: str) -> str:
return f"Results for: {query}"
Make any agent callable as a tool by a parent agent.
from orxhestra.tools import AgentTool
researcher = LlmAgent(name="researcher", model=model, description="Research topics.", instructions="...")
# Parent agent can call researcher as a tool
manager = LlmAgent(
name="manager",
model=model,
tools=[AgentTool(agent=researcher)],
instructions="Use the researcher tool when you need information.",
)
from orxhestra.tools import make_transfer_tool
transfer = make_transfer_tool([sales_agent, support_agent])
triage = LlmAgent(name="triage", model=model, tools=[transfer], instructions="Route requests.")
from orxhestra.tools import exit_loop_tool
reviewer = LlmAgent(
name="reviewer",
model=model,
tools=[exit_loop_tool],
instructions="Call exit_loop when the draft is approved.",
)
from orxhestra.tools import CallContext
class MyTool(BaseTool):
name = "my_tool"
description = "Does something"
async def _arun(self, input: str, **kwargs) -> str:
ctx: CallContext = kwargs.get("tool_context")
if ctx:
ctx.state["last_query"] = input # write to shared state
session_id = ctx.session_id
return f"Processed: {input}"
from orxhestra.integrations.mcp import MCPClient, MCPToolAdapter
# HTTP MCP server
client = MCPClient("http://localhost:8001/mcp")
adapter = MCPToolAdapter(client)
tools = await adapter.load_tools()
agent = LlmAgent(name="agent", model=model, tools=tools)
# In-memory FastMCP server
from mcp_server import mcp # FastMCP instance
client = MCPClient(mcp)
tools = await MCPToolAdapter(client).load_tools()
from orxhestra.tools import LongRunningFunctionTool
async def deploy(env: str) -> str:
"""Deploy to environment."""
await run_deploy(env)
return f"Deployed to {env}"
tool = LongRunningFunctionTool(func=deploy)