Skip to main content
Glama
Google Workspace MCP Server

Google Workspace MCP Server

by akilja24

inspect_doc_structure

Inspect Google Docs structure to find safe insertion indices, locate existing tables, and understand layout before making edits or creating tables.

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

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

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

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

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "user_google_email": "<user_google_email>",
      "document_id": "<document_id>"
    },
    "name": "inspect_doc_structure"
  }
}

Input Schema

NameRequiredDescriptionDefault
detailedNo
document_idYes
user_google_emailYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.13.1

TDQS

A3.7/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full disclosure burden. Read-only, non-mutating behavior is only implied by 'inspect' and 'before making changes', and the 'WHAT THE OUTPUT SHOWS' and 'Returns' sections largely restate fields already covered by the output schema, adding little behavioral value.

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

Conciseness3/5

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

Headers and a numbered workflow make it well organized and front-loaded, but there is redundancy: the safe-insertion-index idea is repeated three times, and the output-field listing duplicates the output schema. Several sections could be collapsed without losing information.

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 moderate-complexity read tool with an output schema, the definition covers purpose, inputs, and the downstream workflow adequately. The main remaining gap is sibling differentiation, which matters here given nearby table- and document-inspection tools.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate, and it does: all three parameters are glossed in the Args block, including the meaning of 'detailed'. The explanation of 'detailed' is thin, not clarifying what extra structure it returns, but overall the parameter gap is closed.

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

Purpose4/5

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

The description states the resource (document structure) and the concrete outcome (safe insertion indices) with a specific use-case list. It does not distinguish itself from close siblings such as debug_table_structure or get_doc_content, so an agent must still infer the boundary.

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 'USE THIS FOR' bullets and the 'ALWAYS call this BEFORE creating tables' directive give a clear trigger condition, reinforced by a 4-step workflow. It stops short of naming when NOT to use it or which sibling to pick instead, so the guidance is clear but not exhaustive.

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