MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / _call

Function _call

src/workflow/structured.py:87–107  ·  view source on GitHub ↗
(tool_input: dict, context: Any)

Source from the content-addressed store, hash-verified

85 """
86
87 def _call(tool_input: dict, context: Any) -> ToolResult:
88 accepted, error = collector.offer(tool_input)
89 if accepted:
90 outbox = getattr(context, "outbox", None)
91 if outbox is not None:
92 outbox.append({"tool": SYNTHETIC_OUTPUT_TOOL_NAME, "structured_output": tool_input})
93 return ToolResult(
94 name=SYNTHETIC_OUTPUT_TOOL_NAME,
95 output={"data": "Structured output accepted.", "structured_output": tool_input},
96 )
97 if collector.exhausted:
98 return ToolResult(
99 name=SYNTHETIC_OUTPUT_TOOL_NAME,
100 output={"data": f"Structured output failed validation after {collector.attempts} attempts: {error}"},
101 is_error=True,
102 )
103 return ToolResult(
104 name=SYNTHETIC_OUTPUT_TOOL_NAME,
105 output={"data": f"Output did not match the schema: {error}. Fix the fields and call StructuredOutput again."},
106 is_error=True,
107 )
108
109 from src.permissions.types import PermissionAllowDecision
110

Callers

nothing calls this directly

Calls 3

ToolResultClass · 0.90
offerMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected