MCPcopy Create free account
hub / github.com/IBM/mcp-cli / _tool_call_response

Function _tool_call_response

tests/planning/test_agentic_loop_integration.py:152–171  ·  view source on GitHub ↗

Build a mock LLM response containing a tool call. Uses the chuk_llm native format (top-level tool_calls key), which is what the real client returns with stream=False.

(name: str, args: dict)

Source from the content-addressed store, hash-verified

150
151
152def _tool_call_response(name: str, args: dict) -> dict:
153 """Build a mock LLM response containing a tool call.
154
155 Uses the chuk_llm native format (top-level tool_calls key),
156 which is what the real client returns with stream=False.
157 """
158 return {
159 "response": None,
160 "tool_calls": [
161 {
162 "id": "call_1",
163 "type": "function",
164 "function": {
165 "name": name,
166 "arguments": json.dumps(args),
167 },
168 }
169 ],
170 "usage": {"prompt_tokens": 50, "completion_tokens": 15},
171 }
172
173
174def _text_response(text: str = "Step complete.") -> dict:

Calls

no outgoing calls

Tested by

no test coverage detected