MCPcopy Index your code
hub / github.com/github/copilot-sdk / _make_tool

Function _make_tool

python/e2e/test_suspend_e2e.py:47–69  ·  view source on GitHub ↗
(name: str, handler)

Source from the content-addressed store, hash-verified

45
46
47def _make_tool(name: str, handler) -> Tool:
48 async def wrapped(invocation: ToolInvocation) -> ToolResult:
49 args = invocation.arguments or {}
50 result = handler(args)
51 if inspect.isawaitable(result):
52 result = await result
53 return ToolResult(text_result_for_llm=str(result))
54
55 return Tool(
56 name=name,
57 description="Transforms a value",
58 parameters={
59 "type": "object",
60 "properties": {
61 "value": {
62 "type": "string",
63 "description": "Value to transform",
64 }
65 },
66 "required": ["value"],
67 },
68 handler=wrapped,
69 )
70
71
72async def _safe_force_stop(client: CopilotClient) -> None:

Calls 1

ToolClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…