Repository navigation
[dotnet-port-api] Add agent-as-tool argument name/description customization - #1157
PratikDhanave (PratikDhanave) wants to merge 4 commits into
Conversation
agenttool hardcoded a single "query" string argument. Add ArgName and ArgDescription config options (defaulting to "query" / "input query to invoke the agent") so callers can rename/re-describe the argument the model sees, mirroring the .NET/Python as-tool argument options. The schema and Call now use the configured name. Partial for microsoft#1139 (session propagation is left for the design discussion on that issue).
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Invalid non-string argument values are silently converted into blank queries instead of returning decoding errors.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
What changed in this PR
Adds configurable argument names and descriptions to agenttool, preserving existing defaults.
Changes:
- Added
ArgNameandArgDescriptionconfiguration. - Updated schema generation and argument forwarding.
- Added custom-argument tests.
| File | Description |
|---|---|
tool/agenttool/agenttool.go |
Implements configurable argument metadata and invocation. |
tool/agenttool/agenttool_test.go |
Tests custom schema and argument forwarding. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
API consistency review
Changed Go contract
Upstream evidence reviewed
AssessmentThis is a scoped, additive parity fix explicitly tracked by #1139. Go's new
|
There was a problem hiding this comment.
🟡 Changes recommended
Exact map lookup introduces an undocumented case-sensitivity compatibility regression.
3 open findings
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
| var query string | ||
| if raw, ok := in[t.argName]; ok { |
| // ArgName overrides the name of the single string argument the tool exposes | ||
| // to the model. Defaults to "query". Mirrors the .NET/Python as-tool | ||
| // argument-name option. |


Partial implementation of #1139.
agenttoolhardcoded a singlequerystring argument with a fixed description. AddArgNameandArgDescriptionconfig options so a caller can rename/re-describe the argument the model sees — mirroring the .NET/Python as-tool argument options.Change
Config.ArgName(default"query") andConfig.ArgDescription(default"input query to invoke the agent").Schema()emits the configured argument name/description;Call()reads the configured key (decoding into a map rather than a fixed struct field).Scoped to the argument customization; session propagation (the other half of #1139) is left for the design discussion there, since obtaining the caller session at
Calltime needs a mechanism the tool interface does not currently expose.Test
TestNew_CustomArgNameAndDescription: a customArgName:"task"is reflected in the schema (and the defaultqueryis gone), andCallwith{"task":...}forwards the value to the agent. Fails to build before the change (fields absent), passes after.