INNER CODE UNIT · JavaScript

listMcpTools

EdgeTypE/better-deepseek · src/background/index.js:813

async function listMcpTools(serverUrl, apiKey = "") {
  try {
    return await mcpJsonRpcRequest(serverUrl, "tools/list", {}, apiKey);
  } catch (err) {
    if (err.status === 404 || err.status === 400) {
      mcpClearInit(serverUrl, apiKey);
      return await mcpJsonRpcRequest(serverUrl, "tools/list", {}, apiKey);
    }
    throw err;
  }
}

async function mcpCallTool(serverUrl, toolName, args = {}, apiKey = "") {
  try {
    return await mcpJsonRpcRequest(serverUrl, "tools/call", { name: toolName, arguments: args }, apiKey);
  } catch (err) {
    if (err.status === 404 || err.status === 400) {
      mcpClearInit(serverUrl, apiKey);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…