(name, args)
| 64 | |
| 65 | let rpcId = 1; |
| 66 | async function tool(name, args) { |
| 67 | const res = await fetch(`${ORIGIN}/rpc`, { |
| 68 | method: 'POST', headers: { 'Content-Type': 'application/json' }, |
| 69 | body: JSON.stringify({ jsonrpc: '2.0', id: rpcId++, method: 'tools/call', params: { name, arguments: args } }), |
| 70 | }); |
| 71 | const body = await res.json(); |
| 72 | const text = body?.result?.content?.[0]?.text ?? ''; |
| 73 | try { return JSON.parse(text); } catch { return { raw: text }; } |
| 74 | } |
| 75 | |
| 76 | /** Der qualifizierte Name eines Symbols, so wie der Index ihn kennt. */ |
| 77 | async function qualifiedName(name) { |
no test coverage detected