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

Function execute_tool

s15_agent_teams/code.py:283–297  ·  view source on GitHub ↗

Execute a tool call block, return output.

(block)

Source from the content-addressed store, hash-verified

281
282
283def execute_tool(block) -> str:
284 """Execute a tool call block, return output."""
285 handler = {
286 "bash": run_bash, "read_file": run_read, "write_file": run_write,
287 "create_task": run_create_task, "list_tasks": run_list_tasks,
288 "get_task": run_get_task, "claim_task": run_claim_task,
289 "complete_task": run_complete_task,
290 "schedule_cron": run_schedule_cron, "list_crons": run_list_crons,
291 "cancel_cron": run_cancel_cron,
292 "spawn_teammate": run_spawn_teammate,
293 "send_message": run_send_message, "check_inbox": run_check_inbox,
294 }.get(block.name)
295 if handler:
296 return handler(**block.input)
297 return f"Unknown tool: {block.name}"
298
299
300def start_background_task(block) -> str:

Callers 2

workerFunction · 0.70
agent_loopFunction · 0.70

Calls 1

getMethod · 0.45

Tested by

no test coverage detected