update_doc_headers_footers
Create or update header or footer text in a Google Doc in a single call, whether it exists or not. Automatically creates if missing, replaces if present.
Instructions
Safely creates or updates header/footer text in a Google Doc.
This is the default tool for header/footer content. Do NOT use batch_update_doc with create_header_footer just to set header/footer text; that low-level operation is only for advanced section-break workflows and can fail when the default header/footer already exists.
This tool handles both creation and update in one call:
If the header/footer does not exist, it is automatically created first.
If the header/footer already exists, its content is replaced.
You do NOT need to create a header/footer separately before calling this tool. Simply call it with the desired content and it will work whether the header/footer exists or not.
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>",
"section_type": "<section_type>",
"content": "<content>"
},
"name": "update_doc_headers_footers"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_google_email | Yes | User's Google email address | |
| document_id | Yes | ID of the document to update | |
| section_type | Yes | Type of section to create or update ("header" or "footer") | |
| content | Yes | Text content for the header/footer | |
| header_footer_type | No | Type of header/footer ("DEFAULT", "FIRST_PAGE_ONLY", "EVEN_PAGE") | DEFAULT |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |