Skip to content
Merged
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
35 changes: 15 additions & 20 deletions src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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. "

Copilot AI Feb 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

「Read mode (sheet + cell_range)」とありますが、実装上は sheet や cell_range が None でも parse_to_json が動作し(全シート/シート全体を対象にする)、必須パラメータではありません。必須に読める表現だと誤った利用(不要な引数指定や動作の誤解)につながるので、任意であることが分かる書き方にしてください。

Suggested change
"2) Read mode (sheet + cell_range) retrieves specific sections. "
"2) Read mode: optionally specify sheet and/or cell_range to retrieve specific sections; "
" if omitted, all sheets or the entire sheet are read. "

Copilot uses AI. Check for mistakes.
"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. "

Copilot AI Feb 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include_row_data の説明が実装と一致していません。実装では row_data は「行全体」ではなく非nullセルの一覧で、ヘッダー行のマッチも除外されません(マッチした行がそのまま返ります)。ツール説明もそれに合わせて誤解のない表現に修正してください。

Suggested change
"- include_row_data (default: false): Search mode - returns entire matched rows (headers excluded). Best for <200 matches. "
"- include_row_data (default: false): Search mode - for each match, returns a list of non-null cells from the matched row (header rows are included when they match). Best for <200 matches. "

Copilot uses AI. Check for mistakes.
"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)."
Comment thread
k-ibaraki marked this conversation as resolved.
Comment thread
k-ibaraki marked this conversation as resolved.
)
)(sharepoint_excel)
logging.info("Registered tool: sharepoint_excel")
Expand Down
Loading