feat: add executeToolWithAttachments for attachment-aware tool execution#43
Merged
feat: add executeToolWithAttachments for attachment-aware tool execution#43
Conversation
3923604 to
6527e46
Compare
📊 Test Coverage
|
Adds a new function for executing MCP tools with automatic handling of large results. When tool output exceeds the configurable threshold, data is stored as an attachment and LLM receives only a summary. Features: - Auto-injection of attachment data into subsequent tool calls - Configurable threshold (env or per-call), data arg name, attachment key - Proper handling of user-provided values (no overwriting falsy values) - 19 unit tests covering all scenarios Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
6527e46 to
f464c21
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
executeToolWithAttachmentsfunction for executing MCP tools with automatic large result handlingChanges
src/graph/attachment-tool-node.ts— main implementationsrc/__tests__/attachment-tool-node.spec.ts— 19 unit testssrc/graph/index.ts— exports new moduleCHANGELOG.md,package.json— version 0.2.2Features
threshold(default 4000 chars, orATTACHMENT_THRESHOLDenv)dataArgName(default"data") for different tool schemasattachmentKeyfor injecting specific attachment instead of latest"",0,null)Test plan
🤖 Generated with Claude Code