Skip to content

Commit 15d3cfb

Browse files
authored
fix: removes unqualified tools from tool list (#84)
* removes unqualified tools from tool list * updates feed to include this change
1 parent deacc2d commit 15d3cfb

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

crates/chat-cli/src/cli/chat/tool_manager.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,7 @@ fn process_tool_specs(
12281228
// This ensures all tool names are valid identifiers that can be safely used in the system
12291229
// If after all of the aforementioned modification the combined tool
12301230
// name we have exceeds a length of 64, we surface it as an error
1231-
for spec in specs {
1231+
for spec in specs.iter_mut() {
12321232
let sn = if !regex.is_match(&spec.name) {
12331233
let mut sn = sanitize_name(spec.name.clone(), regex, &mut hasher);
12341234
while tn_map.contains_key(&sn) {
@@ -1255,6 +1255,9 @@ fn process_tool_specs(
12551255
spec.name = full_name;
12561256
spec.tool_origin = ToolOrigin::McpServer(server_name.to_string());
12571257
}
1258+
// Native origin is the default, and since this function never reads native tools, if we still
1259+
// have it, that would indicate a tool that should not be included.
1260+
specs.retain(|spec| !matches!(spec.tool_origin, ToolOrigin::Native));
12581261
// Send server load success metric datum
12591262
let conversation_id = conversation_id.to_string();
12601263
let _ = telemetry.send_mcp_server_init(conversation_id, None, number_of_tools);

feed.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
"version": "1.10.2",
1717
"title": "Version 1.10.2",
1818
"changes": [
19+
{
20+
"type": "fixed",
21+
"description": "Unqualified tools from being included in the tools schema - [#84](https://github.com/aws/amazon-q-developer-cli-autocomplete/pull/84)"
22+
},
1923
{
2024
"type": "fixed",
2125
"description": "Update stalled stream protection to 12s - [#75](https://github.com/aws/amazon-q-developer-cli-autocomplete/pull/75)"

0 commit comments

Comments
 (0)