| 134 | } |
| 135 | |
| 136 | static char *call_tool(const char *tool, const char *args_fmt, ...) { |
| 137 | char args[1024]; |
| 138 | va_list ap; |
| 139 | va_start(ap, args_fmt); |
| 140 | vsnprintf(args, sizeof(args), args_fmt, ap); |
| 141 | va_end(ap); |
| 142 | return cbm_mcp_handle_tool(g_srv, tool, args); |
| 143 | } |
| 144 | |
| 145 | /* Parse integer from a tool response (handles the nested MCP envelope). |
| 146 | * Matches the JSON forms "key":N / \"key\":N and the TOON scalar `key: N` |
no test coverage detected