MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / _tool_use

Function _tool_use

tests/lib/tools/test_session_runner.py:75–93  ·  view source on GitHub ↗
(
    id: str,
    name: str,
    input: dict[str, Any],
    *,
    evaluated_permission: str | None = None,
    session_thread_id: str | None = None,
)

Source from the content-addressed store, hash-verified

73
74
75def _tool_use(
76 id: str,
77 name: str,
78 input: dict[str, Any],
79 *,
80 evaluated_permission: str | None = None,
81 session_thread_id: str | None = None,
82) -> _StubEvent:
83 # `evaluated_permission` is always present on the real (typed) event —
84 # `None` unless the server evaluated a permission policy for the call.
85 # So is `session_thread_id`, which is `None` for a call of the primary thread.
86 return _StubEvent(
87 "agent.tool_use",
88 id=id,
89 name=name,
90 input=input,
91 evaluated_permission=evaluated_permission,
92 session_thread_id=session_thread_id,
93 )
94
95
96def _tool_result(tool_use_id: str) -> _StubEvent:

Calls 1

_StubEventClass · 0.85

Tested by

no test coverage detected