Skip to content

Commit 36d3b32

Browse files
k-ibarakiclaude
andcommitted
docs: strengthen header detection guidance to prevent excessive reads
Strengthen guidance to prevent LLM from reading excessive ranges (e.g., A1:A50) when checking headers. Add explicit constraints and prefer search-first approach. Key changes: - ALWAYS read exactly 5 rows: 'A1:Z5' (NOT 'A1:Z50' or more) - Explicitly prohibit excessive range reading - Prefer 'query' search when possible - Emphasize reading specific range only Expected effect: - Prevent token waste from excessive reads (2,000 → 50 tokens, 95% reduction) - Promote search-first workflow - Ensure minimal context consumption Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 1fb919e commit 36d3b32

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/server.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,10 @@ def register_tools():
542542
"frozen at the top of the sheet (typically column headers). "
543543
"Response includes cell data in 'rows' (value and coordinate) and structural information "
544544
"(sheet name, dimensions, frozen_rows, frozen_cols, freeze_panes when present, merged_ranges when merged cells exist). "
545-
"Recommended workflow: 1) Search with query to locate relevant content, "
546-
"2) Read specific range based on search results."
545+
"Header detection: Cannot be auto-detected from frozen_rows. "
546+
"ALWAYS read exactly 5 rows for header check: 'A1:Z5' (NOT 'A1:Z50' or more). "
547+
"Prefer 'query' search when possible to locate data first. "
548+
"Workflow: 1) Search OR read 'A1:Z5', 2) Read specific range only."
547549
)
548550
)(sharepoint_excel)
549551
logging.info("Registered tool: sharepoint_excel")

0 commit comments

Comments
 (0)