Skip to main content
Glama
c0webster

Hardened Google Workspace MCP

by c0webster

inspect_doc_structure

Analyze Google Docs structure to identify safe insertion points for tables and understand document layout 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

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_google_emailYes
document_idYes
detailedNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/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. It effectively describes what the tool does: inspects document structure to find safe insertion points and provides statistics. It outlines a workflow and explains the output format. However, it doesn't mention potential limitations, such as document size constraints or permission requirements, which would be helpful for a tool with no annotations.

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

Conciseness4/5

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

The description is well-structured with clear sections (e.g., 'USE THIS FOR:', 'CRITICAL FOR TABLE OPERATIONS:', 'WHAT THE OUTPUT SHOWS:', 'WORKFLOW:'), making it easy to scan. However, it includes some redundancy (e.g., repeating insertion index guidance) and could be more concise by integrating the 'Args' and 'Returns' sections more seamlessly. Overall, it's front-loaded with key information but slightly verbose.

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?

Given the tool's complexity (inspection with safety implications), no annotations, and an output schema present, the description is highly complete. It explains the purpose, usage guidelines, workflow, and output details thoroughly. The presence of an output schema means the description doesn't need to exhaustively list return values, and it effectively covers the critical aspects needed for safe operation, such as the insertion index logic.

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?

The schema description coverage is 0%, so the description must compensate. It lists the three parameters in the 'Args' section but only adds minimal context: 'user_google_email: User's Google email address', 'document_id: ID of the document to inspect', and 'detailed: Whether to return detailed structure information.' This provides basic semantics but lacks details on format (e.g., email validation, document ID sourcing) or the impact of the 'detailed' flag. The description doesn't fully compensate for the schema gap.

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 clearly states the tool's purpose: 'Essential tool for finding safe insertion points and understanding document structure.' It specifies the verb ('finding', 'understanding') and resource ('document structure'), and distinguishes itself from siblings like 'create_table_with_data' by focusing on inspection rather than creation. The title 'inspect_doc_structure' aligns perfectly with this description.

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 description provides explicit guidance on when to use this tool: '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.' It also includes a critical directive: 'ALWAYS call this BEFORE creating tables to get a safe insertion index.' This clearly distinguishes it from alternatives like 'create_table_with_data' or 'insert_doc_elements' by emphasizing its preparatory role.

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/c0webster/hardened-google-workspace-mcp'

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