Conversation
|
Automated review 🤖 Summary of Changes Key Changes & Positives
Potential Issues & Recommendations
Language/Framework Checks
Approval Recommendation
|
There was a problem hiding this comment.
Pull request overview
Adds additional runtime diagnostics around MCP tool invocation to help debug tool-call payloads, and bumps the package patch version.
Changes:
- Log MCP
callToolargument keys atdebuglevel. - Bump
package.jsonversion from1.10.2to1.10.3.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/services/mcp.ts |
Adds DEBUG logging for tool-call argument keys during callTool. |
package.json |
Patch version bump for the package release. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| log({ level: 'info', msg: `Calling tool - ${serverName}:${methodName}` }) | ||
| log({ level: 'debug', msg: `callTool arguments keys: ${Object.keys(args).join(', ')}` }) | ||
| const requestOptions: RequestOptions = {} |
There was a problem hiding this comment.
Object.keys(args) will throw if args is null/undefined. Since request bodies aren’t runtime-validated, args can be missing even though it’s typed as a record. Consider defaulting args to {} (or guarding with args && typeof args === 'object') before calling Object.keys so DEBUG logging can’t crash tool calls.
| } | ||
| } | ||
| log({ level: 'info', msg: `Calling tool - ${serverName}:${methodName}` }) | ||
| log({ level: 'debug', msg: `callTool arguments keys: ${Object.keys(args).join(', ')}` }) |
There was a problem hiding this comment.
This DEBUG log prints all argument keys after secrets are injected, which can reveal secret names (and in the legacy path, potentially the full set of stored secret keys). Consider filtering/removing known secret-related keys (or logging only non-secret keys / a count) to avoid leaking sensitive metadata when DEBUG is enabled.
| log({ level: 'debug', msg: `callTool arguments keys: ${Object.keys(args).join(', ')}` }) | |
| const argKeys = Object.keys(args) | |
| if (allSecrets != null) { | |
| const secretKeys = new Set(Object.keys(allSecrets)) | |
| const nonSecretKeys = argKeys.filter(key => !secretKeys.has(key)) | |
| const secretKeyCount = argKeys.length - nonSecretKeys.length | |
| log({ | |
| level: 'debug', | |
| msg: `callTool arguments: totalKeys=${argKeys.length}, nonSecretKeys=[${nonSecretKeys.join( | |
| ', ' | |
| )}], secretKeyCount=${secretKeyCount}` | |
| }) | |
| } else { | |
| log({ | |
| level: 'debug', | |
| msg: `callTool arguments keys (no secrets injected): ${argKeys.join(', ')}` | |
| }) | |
| } |
|
Automated review 🤖 Summary of Changes Key Changes & Positives
Potential Issues & Recommendations
Language/Framework Checks
Security & Privacy
Build/CI & Ops
Tests
Approval Recommendation
|
No description provided.