File tree Expand file tree Collapse file tree 5 files changed +16
-9
lines changed Expand file tree Collapse file tree 5 files changed +16
-9
lines changed Original file line number Diff line number Diff line change 11
22export const MAX_TOOL_NAME_LENGTH = 64 ;
3- export const SERVER_ID_LENGTH = 16
3+ export const SERVER_ID_LENGTH = 8
Original file line number Diff line number Diff line change @@ -63,6 +63,8 @@ export class ActorsMcpServer {
6363 /**
6464 * Loads tools from URL params.
6565 *
66+ * This method also handles enabling of Actor auto loading via the processParamsGetTools.
67+ *
6668 * Used primarily for SSE.
6769 */
6870 public async loadToolsFromUrl ( url : string , apifyToken : string ) {
@@ -165,7 +167,7 @@ export class ActorsMcpServer {
165167 try {
166168 client = await createMCPClient ( serverTool . serverUrl , apifyToken ) ;
167169 const res = await client . callTool ( {
168- name : name ,
170+ name : serverTool . originToolName ,
169171 arguments : args ,
170172 } ) ;
171173
Original file line number Diff line number Diff line change 11import Ajv from "ajv" ;
22import { ActorMCPTool , ToolWrap } from "../types" ;
33import { Client } from "@modelcontextprotocol/sdk/client/index.js" ;
4- import { getMCPServerID } from "./utils" ;
4+ import { getMCPServerID , getProxyMCPServerToolName } from "./utils" ;
55
66export async function getMCPServerTools (
77 actorID : string ,
@@ -21,7 +21,9 @@ export async function getMCPServerTools(
2121 actorID,
2222 serverId : getMCPServerID ( serverUrl ) ,
2323 serverUrl,
24- name : tool . name ,
24+ originToolName : tool . name ,
25+
26+ name : getProxyMCPServerToolName ( serverUrl , tool . name ) ,
2527 description : tool . description || "" ,
2628 inputSchema : tool . inputSchema ,
2729 ajvValidate : ajv . compile ( tool . inputSchema )
Original file line number Diff line number Diff line change @@ -8,9 +8,6 @@ import type { ToolWrap } from '../types.js';
88
99import { addTool , getActorsAsTools , removeTool } from '../tools/index.js' ;
1010import { Input } from "../types.js" ;
11- import { getActorsMCPServerURL , isActorMCPServer } from "./actors" ;
12- import { getMCPServerTools } from "./proxy" ;
13- import { createMCPClient } from "./client" ;
1411
1512/**
1613 * Generates a unique server ID based on the provided URL.
@@ -32,7 +29,7 @@ export function getMCPServerID(url: string): string {
3229 * @param toolName The tool name to generate the tool name from.
3330 * @returns A unique tool name.
3431 */
35- export function getServerToolName ( url : string , toolName : string ) : string {
32+ export function getProxyMCPServerToolName ( url : string , toolName : string ) : string {
3633 const prefix = getMCPServerID ( url ) ;
3734
3835 const fullName = `${ prefix } -${ toolName } ` ;
Original file line number Diff line number Diff line change @@ -106,10 +106,16 @@ export interface HelperTool extends ToolBase {
106106* Extends ToolBase with tool associated MCP server.
107107*/
108108export interface ActorMCPTool extends ToolBase {
109+ // Origin MCP server tool name, is needed for the tool call
110+ originToolName : string ;
109111 // ID of the Actorized MCP server
110112 actorID : string ;
111- // Name of the Actorized MCP server the tool is associated with
113+ /**
114+ * ID of the Actorized MCP server the tool is associated with.
115+ * See getMCPServerID()
116+ */
112117 serverId : string ;
118+ // Connection URL of the Actorized MCP server
113119 serverUrl : string ;
114120}
115121
You can’t perform that action at this time.
0 commit comments