refactor(mcp): the eight long tool descriptions move into the handbook (P5)
Agent reason: a tool description is read every time the tool list is, so eight descriptions of 800 to 2,000 characters cost every session for text only a few calls need. books.export, books.export_cpa_package, books.import_bank_csv, books.reconcile, books.set_entry_party, books.set_w9, books.show and books.vendor_1099 now say what the tool is for, what it requires and where the rest is, in at most 700 characters; the rest is in the handbook, verbatim: the CPA package's contents (cpa-handoff), the share rules of a multi-party tag and the W-9 procedure (parties-and-tins), the worksheet's construction (1099), the CSV import and the report list with the IIF limits (files-in-out), the reconciliation's answer (reconciliation) and the targets books.show opens (viewer). tool_descriptions_fit_700_characters now pins zero and its allowance list is deleted: no description may exceed the cap, and none is excused. The period test keeps its sentence about omitted dates in books.export's description. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
This commit is contained in:
1 parent
453abb62ea
commit
70a3f795f4
11 files changed
+49
-24
No files matched your search
@@ -716,23 +716,10 @@ fn tool_text_lint() {
|
||||
}
|
||||
}
|
||||
|
||||
/// Tool descriptions are at most 700 characters (plan I-12). The
|
||||
/// ones over it today are listed, each to be shortened in P5 when its
|
||||
/// text moves into the handbook; no new one may join them, and one
|
||||
/// that shrinks under the cap must leave the list.
|
||||
/// Tool descriptions are at most 700 characters (plan I-12); the long
|
||||
/// text lives in the handbook (P5 moved the last eight there).
|
||||
#[test]
|
||||
fn tool_descriptions_fit_700_characters() {
|
||||
// Shorten in P5.
|
||||
const OVER: &[&str] = &[
|
||||
"books.export",
|
||||
"books.export_cpa_package",
|
||||
"books.import_bank_csv",
|
||||
"books.reconcile",
|
||||
"books.set_entry_party",
|
||||
"books.set_w9",
|
||||
"books.show",
|
||||
"books.vendor_1099",
|
||||
];
|
||||
let mut over: Vec<String> = BooksServer::tool_router()
|
||||
.list_all()
|
||||
.iter()
|
||||
@@ -740,7 +727,7 @@ fn tool_descriptions_fit_700_characters() {
|
||||
.map(|t| t.name.to_string())
|
||||
.collect();
|
||||
over.sort();
|
||||
assert_eq!(over, OVER, "tool descriptions over 700 characters");
|
||||
assert!(over.is_empty(), "tool descriptions over 700 characters: {over:?}");
|
||||
}
|
||||
|
||||
/// The tools docs/mcp-interface.md documents: a line (or a bullet)
|
||||
|
||||
Reference in new issue
Block a user