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
| Name | Required | Description | Default |
|---|---|---|---|
| tab_id | No | ||
| detailed | No | ||
| document_id | Yes | ||
| user_google_email | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |