Fix query params bug and use summary for tool names

This commit is contained in:
Ryan Walker 2025-09-09 22:43:45 +00:00
parent f29c277860
commit 3f6243c424
2 changed files with 8 additions and 2 deletions

View File

@ -62,7 +62,7 @@ export function extractToolsFromApi(
}
// Generate a unique name for the tool
let baseName = operation.operationId || generateOperationId(method, path);
let baseName = operation.summary || generateOperationId(method, path);
if (!baseName) continue;
// Sanitize the name to be MCP-compatible (only a-z, 0-9, _, -)

View File

@ -412,7 +412,13 @@ async function executeApiTool(
urlPath = urlPath.replace(\`{\${param.name}}\`, encodeURIComponent(String(value)));
}
else if (param.in === 'query') {
queryParams[param.name] = value;
// Convert arrays to comma-separated strings for query parameters
queryParams[param.name] = Array.isArray(value)
? value
.filter((v) => v !== undefined && v !== null)
.map((v) => String(v))
.join(',')
: value;
}
else if (param.in === 'header') {
headers[param.name.toLowerCase()] = String(value);