diff --git a/src/server.py b/src/server.py index e833b5a..e913dab 100644 --- a/src/server.py +++ b/src/server.py @@ -549,26 +549,21 @@ def register_tools(): if config.is_tool_enabled("sharepoint_excel"): mcp.tool( description=( - "Read or search Excel files in SharePoint. " - "Search mode: use 'query' parameter to find cells containing specific text (returns cell locations and optionally row data). " - "Read mode: use 'sheet' and 'cell_range' parameters to retrieve data from specific sections. " - "When cell_range is specified with include_frozen_rows=True (default), frozen rows are automatically " - "included even if they are outside the specified range. frozen_rows indicates the number of header rows " - "frozen at the top of the sheet (typically column headers). " - "Response includes cell data in 'rows' (value and coordinate) and structural information " - "(sheet name, dimensions, frozen_rows, frozen_cols, freeze_panes when present, merged_ranges when merged cells exist). " - "Cell styles (include_cell_styles, default: false): background colors and sizes. Use only for color-coded data extraction. " - "Header detection: For sheets with frozen_rows > 0, headers are automatically included with include_frozen_rows=True (default). " - "For sheets with frozen_rows=0, headers are not automatically included and context may be unclear. " - "ALWAYS read exactly 5 rows for header check: 'A1:Z5' (NOT 'A1:Z50' or more). " - "IMPORTANT: include_row_data=True returns matched row data only (not headers), same-row matches duplicate data. " - "Always read 'A1:Z5' first for header context. Effective for <200 matches. " - "Prefer 'query' search when possible to locate data first. " - "Workflow: 1) Read 'A1:Z5' for header check (REQUIRED for understanding column structure), " - "2) Search with query (optionally with include_row_data=True to get matched row data), " - "3) Read specific range if needed (include_frozen_rows adds frozen headers automatically), " - "4) If frozen_rows=0 and header context is unclear, retry with expand_axis_range=True " - "to auto-include row 1 (for columns) or column A (for rows)." + "ALWAYS start by reading 'A1:Z5' to understand column structure (required for both modes). " + "Two modes: 1) Search mode (query parameter) finds cells containing text and returns locations with optional row data. " + "2) Read mode (sheet + cell_range) retrieves specific sections. " + "Key parameters: " + "- include_frozen_rows (default: true): Auto-includes frozen header rows even if outside specified range. " + "frozen_rows = header row count " + "- include_cell_styles (default: false): Adds background colors and sizes (20% more tokens) - use for color-coded data only " + "- expand_axis_range (default: false): When frozen_rows=0, auto-expands ranges to include row 1/column A for headers " + "- include_row_data (default: false): Search mode - returns entire matched rows (headers excluded). Best for <200 matches. " + "Recommended workflow: " + "1. Read 'A1:Z5' for headers (NOT 'A1:Z50') - MANDATORY " + "2. Search with query to locate data " + "3. Read specific range if needed (frozen headers auto-included) " + "4. If frozen_rows=0 and context unclear, retry with expand_axis_range=true. " + "Response: rows (value + coordinate), sheet info (dimensions, frozen_rows/cols, freeze_panes/merged_ranges)." ) )(sharepoint_excel) logging.info("Registered tool: sharepoint_excel")