| 120 | } |
| 121 | |
| 122 | static char *call_tool(const char *tool, const char *args_fmt, ...) { |
| 123 | char args[1024]; |
| 124 | va_list ap; |
| 125 | va_start(ap, args_fmt); |
| 126 | vsnprintf(args, sizeof(args), args_fmt, ap); |
| 127 | va_end(ap); |
| 128 | return cbm_mcp_handle_tool(g_srv, tool, args); |
| 129 | } |
| 130 | |
| 131 | /* Parse integer from a tool response (handles the nested MCP envelope). |
| 132 | * Matches the JSON forms "key":N / \"key\":N and the TOON scalar `key: N` |
no test coverage detected