MCPcopy Index your code
hub / github.com/TaskingAI/TaskingAI / ToolOutput

Class ToolOutput

backend/app/models/tool/tool.py:66–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64
65
66class ToolOutput(BaseModel):
67 type: ToolType = Field(
68 ...,
69 description="The tool type, which can be `function` or `action`.",
70 examples=["action", "plugin"],
71 )
72
73 tool_id: str = Field(
74 ...,
75 description="The tool ID.",
76 examples=["action_1"],
77 )
78
79 tool_call_id: str = Field(
80 ...,
81 description="The tool call ID.",
82 examples=["call_1"],
83 )
84
85 status: int = Field(
86 ...,
87 description="The tool output status.",
88 examples=[200, 400, 500],
89 )
90
91 data: Union[Dict, List] = Field(
92 ...,
93 description="The tool output data.",
94 )
95
96 def to_function_message(self):
97 if self.status == 200:
98 return {
99 "role": "function",
100 "content": json.dumps(self.data),
101 "id": self.tool_call_id,
102 }
103 else:
104 return {
105 "role": "function",
106 "content": json.dumps({"status": self.status, "error": self.data}),
107 "id": self.tool_call_id,
108 }

Callers 1

run_toolsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected