Skip to content

Agents can now alter tool call arguments - #95

Open
santanusinha wants to merge 4 commits into
masterfrom
param_merge
Open

Agents can now alter tool call arguments#95
santanusinha wants to merge 4 commits into
masterfrom
param_merge

Conversation

@santanusinha

@santanusinha santanusinha commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Users can implement the relevant function in extension to modify the incoming params which are passed in as a json node. and respond with the modified json node.

During application the extensions are called in sequence and the return from one is passed as param to another.

an extension can throw an exception and the toll call will fail permanenetly

@santanusinha
santanusinha requested a review from gabber12 August 24, 2026 16:42
@github-actions

Copy link
Copy Markdown
Contributor

Maven test summary

  • Total tests: 907
  • Failures: 0
  • Errors: 0
  • Skipped: 3
  • Coverage (LINE): 84.65% (lines covered: 193 / 228)

This comment is automatically generated by the GitHub Actions workflow.

@github-actions

Copy link
Copy Markdown
Contributor

Maven test summary

  • Total tests: 907
  • Failures: 0
  • Errors: 0
  • Skipped: 3
  • Coverage (LINE): 84.65% (lines covered: 193 / 228)

This comment is automatically generated by the GitHub Actions workflow.

@sonarqubecloud

Copy link
Copy Markdown

var argumentNode = mapper
.readTree(toolCall.getArguments());
for (final var extension : this.extensions) {
argumentNode = extension.modifyToolCallArguments(context, (A) this, toolCall, argumentNode);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we fire an eventBus event with the extension class name will be helpful while instrumenting and debugging.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will raise too many events? also events make sens only when arguments are passed input and output .. and we would risk passing sensitive information. the exact reason why i have not added a log there as well.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Purpose will not be to pass arguments but to instrument that an extension method was called and took x time.

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.

3 participants