INNER CODE UNIT · JavaScript

mcpCallTool

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

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);
      return await mcpJsonRpcRequest(serverUrl, "tools/call", { name: toolName, arguments: args }, apiKey);
    }
    throw err;
  }
}

function pathIsAbsolute(p) {
  if (!p || typeof p !== "string") return false;
  return p.startsWith("/") || p.startsWith("\\") || /^[a-zA-Z]:[/\\]/.test(p);
}

/**

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…