Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions rust/crates/tools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -506,13 +506,14 @@ pub fn mvp_tool_specs() -> Vec<ToolSpec> {
},
ToolSpec {
name: "read_file",
description: "Read a text file from the workspace.",
description: "Read a text file from the workspace. Optional `selector` (1-indexed lines; overrides `offset`/`limit`): `50` single line, `50-200` inclusive range, `50+150` start plus count, `5-16,960-973` comma-separated (returned as one block from the first to the last selected line), `raw` for the full file, or `conflicts` for a summary of unresolved git merge conflicts. Without `selector`, `offset` (0-based) and `limit` pick the lines; with neither, the whole file is read.",
input_schema: json!({
"type": "object",
"properties": {
"path": { "type": "string" },
"offset": { "type": "integer", "minimum": 0 },
"limit": { "type": "integer", "minimum": 1 }
"limit": { "type": "integer", "minimum": 1 },
"selector": { "type": "string" }
},
"required": ["path"],
"additionalProperties": false
Expand Down Expand Up @@ -7210,6 +7211,19 @@ mod tests {
);
}

#[test]
fn read_file_schema_exposes_selector() {
let spec = mvp_tool_specs()
.into_iter()
.find(|spec| spec.name == "read_file")
.expect("read_file spec");
assert_eq!(
spec.input_schema["properties"]["selector"],
json!({ "type": "string" })
);
assert!(spec.description.contains("selector"));
}

#[test]
fn git_show_supports_patch_stat_metadata_and_rejects_metadata_path() {
let _guard = env_guard();
Expand Down