Skip to content

Commit e257fd1

Browse files
committed
mcp package: use endpoint method in tool name
1 parent 4646b48 commit e257fd1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/mcp/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ const main = async () => {
197197
}
198198
}
199199

200-
let toolName = endpoint.name.replace(/^\//, '').replace(/\//g, '_');
200+
// Updated code to include the HTTP method in the tool name
201+
const method = endpoint.method.toLowerCase();
202+
let toolName = `${method}_${endpoint.name.replace(/^\//, '').replace(/\//g, '_')}`;
201203
toolName = toolName.replace(/{([^}]+)}/g, 'by_$1');
202204

203205
server.tool(

0 commit comments

Comments
 (0)