Skip to main content
Glama
tom275275

Google Workspace MCP Server

by tom275275

inspect_doc_structure

Find safe insertion points and understand document layout by inspecting structure, element counts, and table positions before making changes.

Instructions

Essential tool for finding safe insertion points and understanding document structure.

USE THIS FOR:

  • Finding the correct index for table insertion

  • Understanding document layout before making changes

  • Locating existing tables and their positions

  • Getting document statistics and complexity info

  • Inspecting structure of specific tabs

CRITICAL FOR TABLE OPERATIONS: ALWAYS call this BEFORE creating tables to get a safe insertion index.

WHAT THE OUTPUT SHOWS:

  • total_elements: Number of document elements

  • total_length: Maximum safe index for insertion

  • tables: Number of existing tables

  • table_details: Position and dimensions of each table

  • tabs: List of available tabs in the document (if no tab_id specified)

WORKFLOW: Step 1: Call this function Step 2: Note the "total_length" value Step 3: Use an index < total_length for table insertion Step 4: Create your table

Args: user_google_email: User's Google email address document_id: ID of the document to inspect detailed: Whether to return detailed structure information tab_id: Optional ID of the tab to inspect. If not provided, inspects main document.

Returns: str: JSON string containing document structure and safe insertion indices

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tab_idNo
detailedNo
document_idYes
user_google_emailYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.14.3

TDQS

A5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure, and it does so comprehensively. It explains what the output contains, how to interpret total_length as an exclusive boundary, how tab_id changes scope, and that the return value is a JSON string. The read-only nature is implied strongly by 'inspect' and 'finding safe insertion points before making changes.'

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?

Although the description is longer than average, it is tightly organized with scannable headings and each section adds unique value. The essential safety warning is front-loaded, and the workflow is concise and directly actionable. No sentence feels redundant or filler.

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

Completeness5/5

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

The description covers all important contextual ground: when to use, what the output means, how to use the result safely, parameter semantics, and tab behavior. An agent can successfully invoke this tool and interpret its output without needing to consult external documentation. The presence of an output schema further reduces ambiguity.

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

Parameters5/5

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

Schema description coverage is 0%, but the description compensates fully by documenting each argument: user_google_email, document_id, detailed, and tab_id. It adds behavioral meaning beyond the schema, such as tab_id defaulting to the main document when omitted. This is a strong recovery from an otherwise bare schema.

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 opens with a specific, actionable purpose: 'finding safe insertion points and understanding document structure.' It further enumerates concrete use cases like locating tables and inspecting tabs, which clearly differentiates it from siblings like get_doc_content or debug_table_structure. The name is reinforced with operational detail rather than merely restated.

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

Usage Guidelines5/5

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

The 'USE THIS FOR' section explicitly lists when to call the tool, and the 'CRITICAL FOR TABLE OPERATIONS' section mandates calling it before table creation. The numbered WORKFLOW gives step-by-step guidance for interpreting the result and choosing a safe index, which is exactly the kind of when-to-use context an agent needs.

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

Deploy Server

Other Tools