Skip to content

Conversation

@jirispilka
Copy link
Collaborator

@jirispilka jirispilka commented Mar 11, 2025

@jirispilka jirispilka requested a review from MQ37 March 11, 2025 13:23
@jirispilka jirispilka self-assigned this Mar 11, 2025
Copy link
Contributor

@MQ37 MQ37 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should handle the case where the tool name > 64 chars, see my comments. Otherwise good job 👍

const SERVER_URL = 'https://actors-mcp-server.apify.actor/sse';
// We need to change forward slash / to underscore -- in the tool name as Anthropic does not allow forward slashes in the tool name
const SELECTED_TOOL = 'apify--rag-web-browser';
const SELECTED_TOOL = 'apify-slash-rag-web-browser';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe use the actorNameToToolName('apify/rag-web-browser')?


const TOOLS = 'apify/rag-web-browser,lukaskrivka/google-maps-with-contact-details';
const SELECTED_TOOL = 'apify--rag-web-browser'; // We need to change / to _ in the tool name
const SELECTED_TOOL = 'apify-slash-rag-web-browser';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

src/actors.ts Outdated
return actorName.replace('/', '--');
return actorName
.replace(/\//g, '-slash-')
.replace(/\./g, '-dot-');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if the tool name is longer that 64 chars after the replace? Based on errors I got from working on 5ire.app MCP supports 64 chars at max. We should maybe use hash of the whole Actor name, slice to the say 60 chars and last 4 replace with the chars from hex digest of the hash.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the problem I was trying to avoid is to have this lookup

            const tool = Array.from(this.tools.values()).find((t) => t.name === name || t.actorFullName === name);

I faced issue with tool names vs Actor names

But I tested it now, with correct tool description it is working fine

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've decided to ignore name collision as of now. I don't think it will happen

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, we can ignore that for now 👍

@jirispilka jirispilka merged commit 8a00881 into master Mar 12, 2025
2 checks passed
@jirispilka jirispilka deleted the feat/rename-tool-name branch March 12, 2025 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error in tool name

2 participants