fix(mcp): use actual tool name from DB instead of parsed name
The tool name shortening logic was correctly finding the tool in the database but then passing the reconstructed parsed.toolName (which may have an incorrect 'Tool' suffix) to the executor instead of using the actual tool name from the database record. This caused 'tool not found' errors when executing tools via MCP SSE even though the tools were listed correctly.
This commit is contained in:
parent
9ebb5ee02e
commit
6fbb104380
1 changed files with 2 additions and 1 deletions
|
|
@ -238,9 +238,10 @@ export async function handleToolsCall(
|
|||
// Use caller-provided env vars if given (non-owner), otherwise use collection's stored env vars
|
||||
const effectiveEnvVars = callerEnvVars ?? (collection?.envVars as Record<string, string>) ?? {};
|
||||
// Pass explicit version to avoid Deno HTTP import cache issues with @latest
|
||||
// Use actual tool name from DB, not parsed name (which may have wrong suffix)
|
||||
const result = await executeWithExecutor(executorConfig, {
|
||||
packageName: actualPackageName,
|
||||
name: parsed.toolName,
|
||||
name: collectionTool.tool.name,
|
||||
version: actualVersion,
|
||||
params: params.arguments ?? {},
|
||||
env: Object.keys(effectiveEnvVars).length > 0 ? effectiveEnvVars : undefined,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue