Merge branch 'main' of github.com:taylorwilsdon/google_workspace_mcp into fix/calendar-meeting-links
This commit is contained in:
@@ -17,6 +17,8 @@ from gdocs.docs_helpers import (
|
||||
create_find_replace_request,
|
||||
create_insert_table_request,
|
||||
create_insert_page_break_request,
|
||||
create_bullet_list_request,
|
||||
create_delete_bullet_list_request,
|
||||
create_insert_doc_tab_request,
|
||||
create_delete_doc_tab_request,
|
||||
create_update_doc_tab_request,
|
||||
@@ -302,6 +304,33 @@ class BatchOperationManager:
|
||||
)
|
||||
description = f"find/replace '{op['find_text']}' → '{op['replace_text']}'"
|
||||
|
||||
elif op_type == "create_bullet_list":
|
||||
list_type = op.get("list_type", "UNORDERED")
|
||||
if list_type not in ("UNORDERED", "ORDERED", "NONE"):
|
||||
raise ValueError(
|
||||
f"Invalid list_type '{list_type}'. Must be 'UNORDERED', 'ORDERED', or 'NONE'"
|
||||
)
|
||||
if list_type == "NONE":
|
||||
request = create_delete_bullet_list_request(
|
||||
op["start_index"], op["end_index"], tab_id
|
||||
)
|
||||
description = f"remove bullets {op['start_index']}-{op['end_index']}"
|
||||
else:
|
||||
request = create_bullet_list_request(
|
||||
op["start_index"],
|
||||
op["end_index"],
|
||||
list_type,
|
||||
op.get("nesting_level"),
|
||||
op.get("paragraph_start_indices"),
|
||||
tab_id,
|
||||
)
|
||||
style = "bulleted" if list_type == "UNORDERED" else "numbered"
|
||||
description = (
|
||||
f"create {style} list {op['start_index']}-{op['end_index']}"
|
||||
)
|
||||
if op.get("nesting_level"):
|
||||
description += f" (nesting level {op['nesting_level']})"
|
||||
|
||||
elif op_type == "insert_doc_tab":
|
||||
request = create_insert_doc_tab_request(
|
||||
op["title"], op["index"], op.get("parent_tab_id")
|
||||
@@ -328,6 +357,7 @@ class BatchOperationManager:
|
||||
"insert_table",
|
||||
"insert_page_break",
|
||||
"find_replace",
|
||||
"create_bullet_list",
|
||||
"insert_doc_tab",
|
||||
"delete_doc_tab",
|
||||
"update_doc_tab",
|
||||
@@ -461,6 +491,15 @@ class BatchOperationManager:
|
||||
"optional": ["match_case"],
|
||||
"description": "Find and replace text throughout document",
|
||||
},
|
||||
"create_bullet_list": {
|
||||
"required": ["start_index", "end_index"],
|
||||
"optional": [
|
||||
"list_type",
|
||||
"nesting_level",
|
||||
"paragraph_start_indices",
|
||||
],
|
||||
"description": "Apply or remove native bullet/numbered list formatting (list_type: UNORDERED, ORDERED, or NONE to remove; nesting_level: 0-8)",
|
||||
},
|
||||
"insert_doc_tab": {
|
||||
"required": ["title", "index"],
|
||||
"description": "Insert a new document tab with given title at specified index",
|
||||
|
||||
@@ -324,9 +324,15 @@ class ValidationManager:
|
||||
|
||||
if named_style_type is not None:
|
||||
valid_styles = [
|
||||
"NORMAL_TEXT", "TITLE", "SUBTITLE",
|
||||
"HEADING_1", "HEADING_2", "HEADING_3",
|
||||
"HEADING_4", "HEADING_5", "HEADING_6",
|
||||
"NORMAL_TEXT",
|
||||
"TITLE",
|
||||
"SUBTITLE",
|
||||
"HEADING_1",
|
||||
"HEADING_2",
|
||||
"HEADING_3",
|
||||
"HEADING_4",
|
||||
"HEADING_5",
|
||||
"HEADING_6",
|
||||
]
|
||||
if named_style_type not in valid_styles:
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user