Skip to content

feat: add executeToolWithAttachments for attachment-aware tool execution#43

Merged
oke11o merged 1 commit intomainfrom
feat/564-attachment-tool-node
Feb 3, 2026
Merged

feat: add executeToolWithAttachments for attachment-aware tool execution#43
oke11o merged 1 commit intomainfrom
feat/564-attachment-tool-node

Conversation

@oke11o
Copy link
Contributor

@oke11o oke11o commented Feb 3, 2026

Summary

  • Adds executeToolWithAttachments function for executing MCP tools with automatic large result handling
  • When tool output exceeds threshold, data is stored as attachment and LLM receives only a summary
  • Auto-injects attachment data into subsequent tool calls when configured data argument is missing

Changes

  • New: src/graph/attachment-tool-node.ts — main implementation
  • New: src/__tests__/attachment-tool-node.spec.ts — 19 unit tests
  • Updated: src/graph/index.ts — exports new module
  • Updated: CHANGELOG.md, package.json — version 0.2.2

Features

  • Configurable threshold (default 4000 chars, or ATTACHMENT_THRESHOLD env)
  • Configurable dataArgName (default "data") for different tool schemas
  • Configurable attachmentKey for injecting specific attachment instead of latest
  • Proper handling of user-provided values (no overwriting falsy values like "", 0, null)

Test plan

  • 19 unit tests pass covering:
    • Threshold detection and attachment creation
    • Auto-injection from latest/specific attachment
    • Custom dataArgName injection
    • User-provided value preservation
    • Error handling and fallbacks
    • Logging behavior
  • Full test suite passes (457 tests)
  • Build succeeds

🤖 Generated with Claude Code

@oke11o oke11o force-pushed the feat/564-attachment-tool-node branch 2 times, most recently from 3923604 to 6527e46 Compare February 3, 2026 18:35
@github-actions
Copy link

github-actions bot commented Feb 3, 2026

📊 Test Coverage

Metric Coverage
Statements 40.5%
Branches 42.7%
Functions 40.6%
Lines 40.4%

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>
@oke11o oke11o force-pushed the feat/564-attachment-tool-node branch from 6527e46 to f464c21 Compare February 3, 2026 19:16
@oke11o oke11o merged commit a101632 into main Feb 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant