Skip to main content
Glama

get-excel-used-range

get-excel-used-range
Read-only

Identify the smallest range containing values or formatting in an Excel worksheet. Returns address, values, formulas, row/column counts to locate populated data before reading or appending.

Instructions

Get an Excel used range.

💡 TIP: Get the smallest range that encompasses any cells with values or formatting on the worksheet. Returns address, values, formulas, numberFormat, rowCount, columnCount. Use this to discover the populated bounds of a sheet before reading or appending — avoids guessing how far data extends. Optional $select to trim the response.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
driveIdYesValue for the 'driveId' path segment. Pass it under the name 'driveId', not as 'id'. Use the 'id' field of the drive object as returned by Microsoft Graph.
driveItemIdYesValue for the 'driveItemId' path segment. Pass it under the name 'driveItemId', not as 'id'. Use the 'id' field of the drive item object as returned by Microsoft Graph.
fetchAllPagesNoFollow @odata.nextLink and merge up to 100 pages into one response. Can return enormous payloads—only when the user explicitly needs a full export. Prefer a small $top first, then paginate or narrow with $filter/$search.
includeHeadersNoInclude response headers (including ETag) in the response metadata
excludeResponseNoExclude the full response body and only return success or failure indication
workbookWorksheetIdYesValue for the 'workbookWorksheetId' path segment. Pass it under the name 'workbookWorksheetId', not as 'id'. Use the 'id' field of the workbook worksheet object as returned by Microsoft Graph.
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, openWorldHint=true, and destructiveHint=false, covering safety. The description adds behavioral detail by enumerating the returned fields (address, values, formulas, numberFormat, rowCount, columnCount) and explaining that it returns the smallest encompassing range. It also hints at response trimming via $select. This goes beyond the annotations and gives the agent a clear picture of the operation's result.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three sentences, with the core purpose first, then a tip explaining the concept, a list of return fields, and a usage recommendation. It is front-loaded, informative, and free of fluff. Every sentence contributes to understanding the tool's function and value. Structure is exemplary.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only retrieval tool with high schema coverage and safety annotations, the description covers the essential aspects: what it returns, when to use it, and how to trim output. It does not describe pagination beyond the fetchAllPages parameter (already in schema) or error handling, but those are not critical for this simple operation. The absence of an output schema is compensated by enumerating returned fields. Overall, an agent has enough guidance to call this tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, with each parameter already described (e.g., driveId, driveItemId, workbookWorksheetId, fetchAllPages). The description does not elaborate on these parameters but adds a tip about the optional $select query, which is not in the schema. This is minor added value. Since the schema does the heavy lifting, a baseline of 3 is appropriate; the $select mention is a small bonus but not enough to raise the score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action ('Get an Excel used range') and elaborates on what a used range is (smallest range with values or formatting) and what it returns (address, values, formulas, etc.). This exceeds a simple verb+resource by clarifying the semantic scope, making it distinct from siblings like get-excel-range, which retrieves an arbitrary range. The purpose is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly recommends using this tool 'to discover the populated bounds of a sheet before reading or appending,' providing clear context on when it is appropriate. It does not name specific alternative tools or exclusion conditions, but the use case is well-defined enough to guide an agent. The mention of '$select to trim the response' adds practical guidance on output control.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/A-Impact-Pavel/ms365-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server