MCPcopy Index your code
hub / github.com/shareAI-lab/learn-claude-code / execute_tool

Function execute_tool

s16_team_protocols/code.py:684–698  ·  view source on GitHub ↗

Execute a tool call block, return output.

(block)

Source from the content-addressed store, hash-verified

682# ── Tool Dispatch ──
683
684def execute_tool(block) -> str:
685 """Execute a tool call block, return output."""
686 handler = {
687 "bash": run_bash, "read_file": run_read, "write_file": run_write,
688 "create_task": run_create_task, "list_tasks": run_list_tasks,
689 "get_task": run_get_task, "claim_task": run_claim_task,
690 "complete_task": run_complete_task,
691 "spawn_teammate": run_spawn_teammate,
692 "send_message": run_send_message, "check_inbox": run_check_inbox,
693 "request_shutdown": run_request_shutdown,
694 "request_plan": run_request_plan, "review_plan": run_review_plan,
695 }.get(block.name)
696 if handler:
697 return handler(**block.input)
698 return f"Unknown tool: {block.name}"
699
700
701# ── Tool Definitions ──

Callers 2

workerFunction · 0.70
agent_loopFunction · 0.70

Calls 1

getMethod · 0.45

Tested by

no test coverage detected