@inkeep/agents-run-api 0.0.0-dev-20251010064032 → 0.0.0-dev-20251010175818

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -7866,6 +7866,45 @@ var Agent = class {
7866
7866
  }
7867
7867
  }
7868
7868
  const tools = await client.tools();
7869
+ if (!tools || Object.keys(tools).length === 0) {
7870
+ const streamRequestId = this.getStreamRequestId();
7871
+ if (streamRequestId) {
7872
+ tracer.startActiveSpan(
7873
+ "ai.toolCall",
7874
+ {
7875
+ attributes: {
7876
+ "ai.toolCall.name": tool3.name,
7877
+ "ai.toolCall.args": JSON.stringify({ operation: "mcp_tool_discovery" }),
7878
+ "ai.toolCall.result": JSON.stringify({
7879
+ status: "no_tools_available",
7880
+ message: `MCP server has 0 effective tools. Double check the selected tools in your graph and the active tools in the MCP server configuration.`,
7881
+ serverUrl: tool3.config.type === "mcp" ? tool3.config.mcp.server.url : "unknown",
7882
+ originalToolName: tool3.name
7883
+ }),
7884
+ "ai.toolType": "mcp",
7885
+ "ai.agentName": this.config.name || "unknown",
7886
+ "conversation.id": this.conversationId || "unknown",
7887
+ "graph.id": this.config.graphId || "unknown",
7888
+ "tenant.id": this.config.tenantId || "unknown",
7889
+ "project.id": this.config.projectId || "unknown"
7890
+ }
7891
+ },
7892
+ (span) => {
7893
+ agentsCore.setSpanWithError(span, new Error(`0 effective tools available for ${tool3.name}`));
7894
+ graphSessionManager.recordEvent(streamRequestId, "tool_execution", this.config.id, {
7895
+ toolName: tool3.name,
7896
+ args: { operation: "mcp_tool_discovery" },
7897
+ result: {
7898
+ status: "no_tools_available",
7899
+ message: `MCP server has 0 effective tools. Double check the selected tools in your graph and the active tools in the MCP server configuration.`,
7900
+ serverUrl: tool3.config.type === "mcp" ? tool3.config.mcp.server.url : "unknown"
7901
+ }
7902
+ });
7903
+ span.end();
7904
+ }
7905
+ );
7906
+ }
7907
+ }
7869
7908
  return tools;
7870
7909
  }
7871
7910
  async createMcpConnection(tool3, serverConfig) {
@@ -7885,6 +7924,17 @@ var Agent = class {
7885
7924
  },
7886
7925
  "Agent failed to connect to MCP server"
7887
7926
  );
7927
+ if (error instanceof Error) {
7928
+ if (error?.cause && JSON.stringify(error.cause).includes("ECONNREFUSED")) {
7929
+ const errorMessage = "Connection refused. Please check if the MCP server is running.";
7930
+ throw new Error(errorMessage);
7931
+ } else if (error.message.includes("404")) {
7932
+ const errorMessage = "Error accessing endpoint (HTTP 404)";
7933
+ throw new Error(errorMessage);
7934
+ } else {
7935
+ throw new Error(`MCP server connection failed: ${error.message}`);
7936
+ }
7937
+ }
7888
7938
  throw error;
7889
7939
  }
7890
7940
  }
package/dist/index.js CHANGED
@@ -7042,6 +7042,45 @@ var Agent = class {
7042
7042
  }
7043
7043
  }
7044
7044
  const tools = await client.tools();
7045
+ if (!tools || Object.keys(tools).length === 0) {
7046
+ const streamRequestId = this.getStreamRequestId();
7047
+ if (streamRequestId) {
7048
+ tracer.startActiveSpan(
7049
+ "ai.toolCall",
7050
+ {
7051
+ attributes: {
7052
+ "ai.toolCall.name": tool3.name,
7053
+ "ai.toolCall.args": JSON.stringify({ operation: "mcp_tool_discovery" }),
7054
+ "ai.toolCall.result": JSON.stringify({
7055
+ status: "no_tools_available",
7056
+ message: `MCP server has 0 effective tools. Double check the selected tools in your graph and the active tools in the MCP server configuration.`,
7057
+ serverUrl: tool3.config.type === "mcp" ? tool3.config.mcp.server.url : "unknown",
7058
+ originalToolName: tool3.name
7059
+ }),
7060
+ "ai.toolType": "mcp",
7061
+ "ai.agentName": this.config.name || "unknown",
7062
+ "conversation.id": this.conversationId || "unknown",
7063
+ "graph.id": this.config.graphId || "unknown",
7064
+ "tenant.id": this.config.tenantId || "unknown",
7065
+ "project.id": this.config.projectId || "unknown"
7066
+ }
7067
+ },
7068
+ (span) => {
7069
+ setSpanWithError(span, new Error(`0 effective tools available for ${tool3.name}`));
7070
+ graphSessionManager.recordEvent(streamRequestId, "tool_execution", this.config.id, {
7071
+ toolName: tool3.name,
7072
+ args: { operation: "mcp_tool_discovery" },
7073
+ result: {
7074
+ status: "no_tools_available",
7075
+ message: `MCP server has 0 effective tools. Double check the selected tools in your graph and the active tools in the MCP server configuration.`,
7076
+ serverUrl: tool3.config.type === "mcp" ? tool3.config.mcp.server.url : "unknown"
7077
+ }
7078
+ });
7079
+ span.end();
7080
+ }
7081
+ );
7082
+ }
7083
+ }
7045
7084
  return tools;
7046
7085
  }
7047
7086
  async createMcpConnection(tool3, serverConfig) {
@@ -7061,6 +7100,17 @@ var Agent = class {
7061
7100
  },
7062
7101
  "Agent failed to connect to MCP server"
7063
7102
  );
7103
+ if (error instanceof Error) {
7104
+ if (error?.cause && JSON.stringify(error.cause).includes("ECONNREFUSED")) {
7105
+ const errorMessage = "Connection refused. Please check if the MCP server is running.";
7106
+ throw new Error(errorMessage);
7107
+ } else if (error.message.includes("404")) {
7108
+ const errorMessage = "Error accessing endpoint (HTTP 404)";
7109
+ throw new Error(errorMessage);
7110
+ } else {
7111
+ throw new Error(`MCP server connection failed: ${error.message}`);
7112
+ }
7113
+ }
7064
7114
  throw error;
7065
7115
  }
7066
7116
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-run-api",
3
- "version": "0.0.0-dev-20251010064032",
3
+ "version": "0.0.0-dev-20251010175818",
4
4
  "description": "Agents Run API for Inkeep Agent Framework - handles chat, agent execution, and streaming",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -51,7 +51,7 @@
51
51
  "traverse": "^0.6.11",
52
52
  "ts-pattern": "^5.7.1",
53
53
  "zod": "^4.1.11",
54
- "@inkeep/agents-core": "^0.0.0-dev-20251010064032"
54
+ "@inkeep/agents-core": "^0.0.0-dev-20251010175818"
55
55
  },
56
56
  "optionalDependencies": {
57
57
  "keytar": "^7.9.0"