tools

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package tools registers the MCP tools. Handlers validate input, call the service, and shape the result; every rule worth testing lives in the service.

Index

Constants

View Source
const MaxMaxChars = 400000

MaxMaxChars caps a caller's budget.

Variables

This section is empty.

Functions

func Register

func Register(s *mcp.Server, d Deps)

Register adds every tool the configuration allows.

Types

type AddCommentInput added in v0.2.0

type AddCommentInput struct {
	Document       string       `json:"document" jsonschema:"document id or any docs.google.com URL"`
	Target         *TargetInput `` /* 130-byte string literal not displayed */
	Content        string       `json:"content" jsonschema:"the comment text (plain text, up to 2048 bytes)"`
	Assignee       string       `json:"assignee,omitempty" jsonschema:"email address to assign the comment to (Developer Preview only)"`
	ExpectRevision string       `json:"expect_revision,omitempty" jsonschema:"fail if the document is no longer at this revision id"`
}

AddCommentInput posts a thread.

type CellInput added in v0.2.0

type CellInput struct {
	Cell    string `json:"cell" jsonschema:"cell name relative to the table, e.g. r2c3"`
	Content string `json:"content" jsonschema:"new cell content as markdown; use content_format text for one paragraph per line"`
}

CellInput is new content for one cell.

type CreateInput

type CreateInput struct {
	Title         string `json:"title" jsonschema:"document title"`
	Content       string `json:"content,omitempty" jsonschema:"initial content as markdown"`
	ContentFormat string `json:"content_format,omitempty" jsonschema:"markdown (default) or text"`
}

CreateInput is the create_document call.

type DeleteCommentInput added in v0.2.0

type DeleteCommentInput struct {
	Document  string `json:"document" jsonschema:"document id or any docs.google.com URL"`
	CommentID string `json:"comment_id" jsonschema:"thread id from list_comments"`
	ReplyID   string `json:"reply_id,omitempty" jsonschema:"delete only this reply of the thread"`
	Confirm   string `json:"confirm_comment_id,omitempty" jsonschema:"repeat comment_id exactly; the deletion is refused without it"`
}

DeleteCommentInput removes a thread or a reply.

type DeleteTabInput added in v0.2.0

type DeleteTabInput struct {
	Document       string `json:"document" jsonschema:"document id or any docs.google.com URL"`
	Tab            string `json:"tab" jsonschema:"the tab to delete, by id, title or number; its child tabs go with it"`
	ConfirmTab     string `json:"confirm_tab,omitempty" jsonschema:"repeat the tab exactly; the deletion is refused without it"`
	ExpectRevision string `json:"expect_revision,omitempty"`
}

DeleteTabInput is the delete_tab call.

type Deps

type Deps struct {
	Service *service.Service
	Config  config.Config
	Logger  *slog.Logger
}

Deps are what the tools need.

type DiffInput added in v0.2.0

type DiffInput struct {
	Document string `json:"document" jsonschema:"document id or any docs.google.com URL"`
	From     string `json:"from" jsonschema:"the older revision id from list_revisions"`
	To       string `json:"to,omitempty" jsonschema:"the newer revision id from list_revisions; default the current content"`
	Format   string `json:"format,omitempty" jsonschema:"md (default) or txt: which export to compare"`
	Context  int    `json:"context,omitempty" jsonschema:"unchanged lines shown around each change; default 2"`
	MaxChars int    `json:"max_chars,omitempty" jsonschema:"output budget in characters, cut at a hunk boundary; default 20000"`
}

DiffInput compares two revisions.

type DocumentInput

type DocumentInput struct {
	Document string `json:"document" jsonschema:"document id or any docs.google.com URL"`
}

DocumentInput identifies a document.

type EditInput

type EditInput struct {
	Document       string        `json:"document" jsonschema:"document id or any docs.google.com URL"`
	Ops            []EditOpInput `` /* 127-byte string literal not displayed */
	Mode           string        `` /* 233-byte string literal not displayed */
	DryRun         bool          `` /* 143-byte string literal not displayed */
	ExpectRevision string        `json:"expect_revision,omitempty" jsonschema:"fail if the document is no longer at this revision id"`
	Force          bool          `` /* 165-byte string literal not displayed */
}

EditInput is the edit_document call.

type EditOpInput

type EditOpInput struct {
	Op            string         `` /* 232-byte string literal not displayed */
	Target        *TargetInput   `json:"target,omitempty" jsonschema:"what replace, delete or replace_all (tab only) act on"`
	Location      *LocationInput `` /* 128-byte string literal not displayed */
	Content       string         `` /* 230-byte string literal not displayed */
	ContentFormat string         `json:"content_format,omitempty" jsonschema:"markdown (default) or text for verbatim text, one paragraph per line"`
	Find          string         `json:"find,omitempty" jsonschema:"replace_all: the text to find"`
	Replace       string         `json:"replace,omitempty" jsonschema:"replace_all: the replacement text (may be empty)"`
	MatchCase     bool           `json:"match_case,omitempty" jsonschema:"replace_all: match case exactly"`
	Name          string         `json:"name,omitempty" jsonschema:"named ranges: the name to give the target, or the name of the range to delete or fill"`
	RangeID       string         `` /* 131-byte string literal not displayed */
	Text          string         `json:"text,omitempty" jsonschema:"replace_named_range: the plain text to write over the range, with no newline"`
}

EditOpInput is one edit_document operation.

type ExportInput

type ExportInput struct {
	Document string `json:"document" jsonschema:"document id or any docs.google.com URL"`
	Format   string `json:"format" jsonschema:"md, txt or html (returned inline); pdf, docx, odt, rtf or epub (written under GDOCS_EXPORT_DIR)"`
	MaxChars int    `json:"max_chars,omitempty" jsonschema:"inline formats: character budget, default 20000"`
}

ExportInput is the export_document call.

type FindInput

type FindInput struct {
	Document  string `json:"document" jsonschema:"document id or any docs.google.com URL"`
	Query     string `json:"query" jsonschema:"text to find (normalised exact match) or a regular expression when regex is true"`
	Regex     bool   `json:"regex,omitempty" jsonschema:"treat query as an RE2 regular expression"`
	MatchCase bool   `json:"match_case,omitempty" jsonschema:"match case exactly; default case-insensitive"`
	Tab       string `json:"tab,omitempty" jsonschema:"tab id, title or number; default the first tab"`
	Segment   string `json:"segment,omitempty" jsonschema:"body (default), header, footer or footnote"`
	Limit     int    `json:"limit,omitempty" jsonschema:"maximum matches to return; default 50"`
	Context   int    `json:"context,omitempty" jsonschema:"characters of context on each side; default 60"`
}

FindInput is the find_in_document call.

type FormatInput

type FormatInput struct {
	Document       string          `json:"document" jsonschema:"document id or any docs.google.com URL"`
	Ops            []FormatOpInput `json:"ops"`
	Mode           string          `json:"mode,omitempty" jsonschema:"suggest, direct or comment; default from get_document capabilities"`
	DryRun         bool            `json:"dry_run,omitempty"`
	ExpectRevision string          `json:"expect_revision,omitempty"`
}

FormatInput is the format_document call.

type FormatOpInput

type FormatOpInput struct {
	Op                  string      `json:"op" jsonschema:"text_style, paragraph_style, bullets, clear_formatting"`
	Target              TargetInput `json:"target"`
	Bold                *bool       `json:"bold,omitempty"`
	Italic              *bool       `json:"italic,omitempty"`
	Underline           *bool       `json:"underline,omitempty"`
	Strikethrough       *bool       `json:"strikethrough,omitempty"`
	SmallCaps           *bool       `json:"small_caps,omitempty"`
	Font                string      `json:"font,omitempty" jsonschema:"font family name, or none to inherit"`
	SizePt              float64     `json:"size_pt,omitempty" jsonschema:"font size in points"`
	Color               string      `json:"color,omitempty" jsonschema:"text colour as #rrggbb, or none"`
	Background          string      `json:"background,omitempty" jsonschema:"highlight colour as #rrggbb, or none"`
	Link                string      `json:"link,omitempty" jsonschema:"URL to link the text to, or none to remove the link"`
	Baseline            string      `json:"baseline,omitempty" jsonschema:"SUPERSCRIPT, SUBSCRIPT or NONE"`
	NamedStyle          string      `json:"named_style,omitempty" jsonschema:"paragraph_style: NORMAL_TEXT, TITLE, SUBTITLE, HEADING_1 … HEADING_6"`
	Alignment           string      `json:"alignment,omitempty" jsonschema:"paragraph_style: START, CENTER, END, JUSTIFIED"`
	LineSpacing         float64     `json:"line_spacing,omitempty" jsonschema:"paragraph_style: percent, 100 = single"`
	SpaceAbovePt        *float64    `json:"space_above_pt,omitempty"`
	SpaceBelowPt        *float64    `json:"space_below_pt,omitempty"`
	IndentPt            *float64    `json:"indent_pt,omitempty" jsonschema:"paragraph_style: left indent in points"`
	FirstLineIndentPt   *float64    `json:"first_line_indent_pt,omitempty"`
	KeepWithNext        *bool       `json:"keep_with_next,omitempty"`
	PageBreakBefore     *bool       `json:"page_break_before,omitempty" jsonschema:"paragraph_style: start this paragraph on a new page"`
	IndentEndPt         *float64    `json:"indent_end_pt,omitempty" jsonschema:"paragraph_style: right indent in points"`
	Direction           string      `json:"direction,omitempty" jsonschema:"paragraph_style: left_to_right (default) or right_to_left"`
	SpacingMode         string      `` /* 132-byte string literal not displayed */
	KeepLinesTogether   *bool       `json:"keep_lines_together,omitempty" jsonschema:"paragraph_style: keep the paragraph on one page"`
	AvoidWidowAndOrphan *bool       `json:"avoid_widow_and_orphan,omitempty" jsonschema:"paragraph_style: keep single lines off page boundaries"`
	Shading             string      `json:"shading,omitempty" jsonschema:"paragraph_style: paragraph background as #rrggbb, or none"`
	Border              string      `` /* 212-byte string literal not displayed */
	BorderTop           string      `json:"border_top,omitempty" jsonschema:"paragraph_style: the top edge alone, same form as border"`
	BorderBottom        string      `json:"border_bottom,omitempty"`
	BorderLeft          string      `json:"border_left,omitempty"`
	BorderRight         string      `json:"border_right,omitempty"`
	BorderBetween       string      `json:"border_between,omitempty" jsonschema:"paragraph_style: the edge drawn between consecutive paragraphs that share it"`
	BorderPaddingPt     *float64    `json:"border_padding_pt,omitempty" jsonschema:"paragraph_style: space between the border and the text, in points"`
	Bullets             string      `json:"bullets,omitempty" jsonschema:"bullets op: bullet, numbered, checkbox, or none to remove list formatting"`
}

FormatOpInput is one format_document operation.

type LayoutInput added in v0.4.0

type LayoutInput struct {
	Document       string          `json:"document" jsonschema:"document id or any docs.google.com URL"`
	Ops            []LayoutOpInput `json:"ops" jsonschema:"operations applied together as one atomic batch"`
	Mode           string          `json:"mode,omitempty" jsonschema:"suggest, direct or comment; default from get_document capabilities"`
	DryRun         bool            `json:"dry_run,omitempty"`
	ExpectRevision string          `json:"expect_revision,omitempty"`
}

LayoutInput is the layout_document call.

type LayoutOpInput added in v0.4.0

type LayoutOpInput struct {
	Op       string         `` /* 225-byte string literal not displayed */
	Tab      string         `json:"tab,omitempty" jsonschema:"page and named_style: tab id, title or number; default the first tab"`
	Target   *TargetInput   `json:"target,omitempty" jsonschema:"section: any text or block inside the section to style"`
	Location *LocationInput `json:"location,omitempty" jsonschema:"section_break: where the new section starts"`

	PageWidthPt           float64  `json:"page_width_pt,omitempty" jsonschema:"page: page width in points (US Letter is 612, A4 is 595); set with page_height_pt"`
	PageHeightPt          float64  `json:"page_height_pt,omitempty" jsonschema:"page: page height in points (US Letter is 792, A4 is 842)"`
	MarginTopPt           *float64 `json:"margin_top_pt,omitempty" jsonschema:"page and section: top margin in points"`
	MarginBottomPt        *float64 `json:"margin_bottom_pt,omitempty" jsonschema:"page and section: bottom margin in points"`
	MarginLeftPt          *float64 `json:"margin_left_pt,omitempty" jsonschema:"page and section: left margin in points"`
	MarginRightPt         *float64 `json:"margin_right_pt,omitempty" jsonschema:"page and section: right margin in points"`
	MarginHeaderPt        *float64 `json:"margin_header_pt,omitempty" jsonschema:"page: distance from the top of the page to the header"`
	MarginFooterPt        *float64 `json:"margin_footer_pt,omitempty" jsonschema:"page: distance from the bottom of the page to the footer"`
	Background            string   `json:"background,omitempty" jsonschema:"page: page colour as #rrggbb, or none"`
	Landscape             *bool    `json:"landscape,omitempty" jsonschema:"page and section: turn the page on its side"`
	PageNumberStart       *int     `json:"page_number_start,omitempty" jsonschema:"page and section: the number the first page carries"`
	FirstPageHeaderFooter *bool    `json:"first_page_header_footer,omitempty" jsonschema:"page and section: give the first page its own header and footer"`
	EvenPageHeaderFooter  *bool    `json:"even_page_header_footer,omitempty" jsonschema:"page: give even pages their own header and footer"`

	Columns          int      `json:"columns,omitempty" jsonschema:"section: how many columns the text runs in, 1-3"`
	ColumnGapPt      *float64 `json:"column_gap_pt,omitempty" jsonschema:"section: space after each column in points"`
	ColumnSeparator  string   `json:"column_separator,omitempty" jsonschema:"section: none (default) or between, for a line between columns"`
	ContentDirection string   `json:"content_direction,omitempty" jsonschema:"section: left_to_right (default) or right_to_left"`
	SectionType      string   `` /* 178-byte string literal not displayed */

	Style               string   `` /* 130-byte string literal not displayed */
	Bold                *bool    `json:"bold,omitempty" jsonschema:"named_style: as in format_document"`
	Italic              *bool    `json:"italic,omitempty"`
	Underline           *bool    `json:"underline,omitempty"`
	Strikethrough       *bool    `json:"strikethrough,omitempty"`
	SmallCaps           *bool    `json:"small_caps,omitempty"`
	Font                string   `json:"font,omitempty" jsonschema:"named_style: font family name, or none to inherit"`
	SizePt              float64  `json:"size_pt,omitempty" jsonschema:"named_style: font size in points"`
	Color               string   `json:"color,omitempty" jsonschema:"named_style: text colour as #rrggbb, or none"`
	TextBackground      string   `json:"text_background,omitempty" jsonschema:"named_style: highlight colour as #rrggbb, or none"`
	Alignment           string   `json:"alignment,omitempty" jsonschema:"named_style: START, CENTER, END, JUSTIFIED"`
	LineSpacing         float64  `json:"line_spacing,omitempty" jsonschema:"named_style: percent, 100 = single"`
	SpaceAbovePt        *float64 `json:"space_above_pt,omitempty"`
	SpaceBelowPt        *float64 `json:"space_below_pt,omitempty"`
	IndentPt            *float64 `json:"indent_pt,omitempty"`
	FirstLineIndentPt   *float64 `json:"first_line_indent_pt,omitempty"`
	KeepWithNext        *bool    `json:"keep_with_next,omitempty"`
	PageBreakBefore     *bool    `json:"page_break_before,omitempty" jsonschema:"named_style: start every paragraph of this style on a new page"`
	IndentEndPt         *float64 `json:"indent_end_pt,omitempty" jsonschema:"named_style: right indent in points"`
	Direction           string   `json:"direction,omitempty" jsonschema:"named_style: left_to_right (default) or right_to_left"`
	SpacingMode         string   `json:"spacing_mode,omitempty" jsonschema:"named_style: never_collapse or collapse_lists"`
	KeepLinesTogether   *bool    `json:"keep_lines_together,omitempty"`
	AvoidWidowAndOrphan *bool    `json:"avoid_widow_and_orphan,omitempty"`
	Shading             string   `json:"shading,omitempty" jsonschema:"named_style: paragraph background as #rrggbb, or none"`
	Border              string   `` /* 154-byte string literal not displayed */
	BorderTop           string   `json:"border_top,omitempty"`
	BorderBottom        string   `json:"border_bottom,omitempty"`
	BorderLeft          string   `json:"border_left,omitempty"`
	BorderRight         string   `json:"border_right,omitempty"`
	BorderBetween       string   `json:"border_between,omitempty" jsonschema:"named_style: the edge between consecutive paragraphs sharing this style"`
	BorderPaddingPt     *float64 `json:"border_padding_pt,omitempty" jsonschema:"named_style: space between border and text, in points"`
}

LayoutOpInput is one layout_document operation. Every measurement is in points: 72 pt to the inch, so a one-inch margin is 72.

type ListCommentsInput added in v0.2.0

type ListCommentsInput struct {
	Document       string `json:"document" jsonschema:"document id or any docs.google.com URL"`
	HideResolved   bool   `json:"hide_resolved,omitempty" jsonschema:"leave out resolved threads; default shows them"`
	IncludeDeleted bool   `json:"include_deleted,omitempty" jsonschema:"also list deleted threads (their text is gone)"`
}

ListCommentsInput selects comment threads.

type LocationInput

type LocationInput struct {
	At string       `` /* 204-byte string literal not displayed */
	Of *TargetInput `json:"of,omitempty" jsonschema:"the block, section or text the position is relative to"`
}

LocationInput says where an insertion goes.

type ObjectInput added in v0.2.0

type ObjectInput struct {
	Document       string        `json:"document" jsonschema:"document id or any docs.google.com URL"`
	Action         string        `` /* 128-byte string literal not displayed */
	Kind           string        `json:"kind,omitempty" jsonschema:"insert: image, person, rich_link, or date"`
	Object         string        `json:"object,omitempty" jsonschema:"replace and delete: the object's id as a read shows it, e.g. kix.img1"`
	Crop           bool          `` /* 130-byte string literal not displayed */
	Tab            string        `json:"tab,omitempty" jsonschema:"replace and delete: tab id, title or number; default the first tab"`
	Location       LocationInput `` /* 145-byte string literal not displayed */
	URL            string        `` /* 187-byte string literal not displayed */
	WidthPt        float64       `json:"width_pt,omitempty" jsonschema:"image: width in points; with only one dimension the aspect ratio is kept"`
	HeightPt       float64       `json:"height_pt,omitempty" jsonschema:"image: height in points"`
	Email          string        `json:"email,omitempty" jsonschema:"person: the email address of the person chip"`
	Name           string        `json:"name,omitempty" jsonschema:"person: display name shown on the chip"`
	Title          string        `json:"title,omitempty" jsonschema:"rich_link: display title (Google fills it from the resource when omitted)"`
	Date           string        `json:"date,omitempty" jsonschema:"date: the date as YYYY-MM-DD or an RFC 3339 timestamp"`
	TimeZone       string        `json:"time_zone,omitempty" jsonschema:"date: IANA time zone id such as Europe/Copenhagen; default UTC"`
	DateFormat     string        `` /* 148-byte string literal not displayed */
	WithTime       bool          `json:"with_time,omitempty" jsonschema:"date: also show the time"`
	Mode           string        `json:"mode,omitempty" jsonschema:"suggest, direct or comment; default from get_document capabilities"`
	DryRun         bool          `json:"dry_run,omitempty"`
	ExpectRevision string        `json:"expect_revision,omitempty"`
	Force          bool          `` /* 151-byte string literal not displayed */
}

ObjectInput is the insert_object call.

type OutlineInput

type OutlineInput struct {
	Document string `json:"document" jsonschema:"document id or any docs.google.com URL"`
	Tab      string `json:"tab,omitempty" jsonschema:"tab id, title or number to limit the outline to; default all tabs"`
}

OutlineInput selects a document and optionally one tab.

type ReadInput

type ReadInput struct {
	Document           string `json:"document" jsonschema:"document id or any docs.google.com URL"`
	Tab                string `json:"tab,omitempty" jsonschema:"tab id, title or number; default the first tab"`
	Segment            string `json:"segment,omitempty" jsonschema:"body (default), header, footer or footnote, optionally numbered (header2, footnote3)"`
	HeadingID          string `` /* 126-byte string literal not displayed */
	Heading            string `json:"heading,omitempty" jsonschema:"read one section by its heading text (whole heading, case-insensitive)"`
	HeadingLevel       int    `json:"heading_level,omitempty" jsonschema:"only match headings of this level (1-6) when using heading"`
	Occurrence         int    `json:"occurrence,omitempty" jsonschema:"which match to use when the heading text repeats, 1-based"`
	FromHandle         string `` /* 128-byte string literal not displayed */
	ToHandle           string `json:"to_handle,omitempty" jsonschema:"last block handle of the range, inclusive"`
	ContinueFrom       string `json:"continue_from,omitempty" jsonschema:"the continue_from handle returned by a truncated read; resumes there"`
	Format             string `json:"format,omitempty" jsonschema:"markdown (default), text, or raw (Docs API JSON for the scoped blocks)"`
	WithHandles        *bool  `` /* 219-byte string literal not displayed */
	WithStyles         bool   `` /* 164-byte string literal not displayed */
	IncludeSuggestions bool   `` /* 211-byte string literal not displayed */
	IncludeComments    bool   `` /* 169-byte string literal not displayed */
	MaxChars           int    `json:"max_chars,omitempty" jsonschema:"output budget in characters, cut at a block boundary; default 20000, maximum 400000"`
	Revision           string `` /* 186-byte string literal not displayed */
}

ReadInput scopes a read.

type ReplyInput added in v0.2.0

type ReplyInput struct {
	Document  string `json:"document" jsonschema:"document id or any docs.google.com URL"`
	CommentID string `json:"comment_id" jsonschema:"thread id from list_comments or add_comment"`
	ReplyID   string `json:"reply_id,omitempty" jsonschema:"edit: the reply to rewrite; without it the thread's own comment is rewritten"`
	Content   string `json:"content,omitempty" jsonschema:"reply text; required for a plain reply and for edit, optional with resolve or reopen"`
	Action    string `json:"action,omitempty" jsonschema:"reply (default), resolve, reopen, or edit"`
}

ReplyInput continues a thread.

type ReviewInput

type ReviewInput struct {
	Document       string   `json:"document" jsonschema:"document id or any docs.google.com URL"`
	Action         string   `json:"action" jsonschema:"accept, reject, or discard (author only)"`
	IDs            []string `json:"ids,omitempty" jsonschema:"suggestion ids from list_suggestions"`
	All            bool     `json:"all,omitempty" jsonschema:"act on every pending suggestion"`
	ExpectRevision string   `json:"expect_revision,omitempty"`
}

ReviewInput is the review_suggestion call.

type RevisionsInput added in v0.2.0

type RevisionsInput struct {
	Document string `json:"document" jsonschema:"document id or any docs.google.com URL"`
	Limit    int    `json:"limit,omitempty" jsonschema:"how many of the newest revisions to return; default 20, max 200"`
}

RevisionsInput lists version history.

type SearchInput

type SearchInput struct {
	Query         string `json:"query,omitempty" jsonschema:"words that must appear in the document text"`
	Title         string `json:"title,omitempty" jsonschema:"words that must appear in the title"`
	ModifiedAfter string `json:"modified_after,omitempty" jsonschema:"only documents modified after this date (YYYY-MM-DD or RFC 3339)"`
	Owner         string `json:"owner,omitempty" jsonschema:"owner email address"`
	Limit         int    `json:"limit,omitempty" jsonschema:"page size, default 20, max 100"`
	PageToken     string `json:"page_token,omitempty" jsonschema:"next_page_token from a previous result"`
}

SearchInput is the search_documents call.

type TabInput added in v0.2.0

type TabInput struct {
	Document       string `json:"document" jsonschema:"document id or any docs.google.com URL"`
	Action         string `json:"action" jsonschema:"add, rename, or move"`
	Tab            string `json:"tab,omitempty" jsonschema:"rename, move: the tab to change, by id, title or number"`
	Title          string `json:"title,omitempty" jsonschema:"add, rename: the tab title"`
	Position       int    `json:"position,omitempty" jsonschema:"add, move: 1-based position among its sibling tabs"`
	Parent         string `json:"parent,omitempty" jsonschema:"add, move: nest under this tab (id, title or number)"`
	Emoji          string `json:"emoji,omitempty" jsonschema:"add, rename: a single emoji as the tab icon"`
	Content        string `json:"content,omitempty" jsonschema:"add: initial content as markdown"`
	ExpectRevision string `json:"expect_revision,omitempty"`
}

TabInput is the manage_tabs call.

type TableInput added in v0.2.0

type TableInput struct {
	Document       string         `json:"document" jsonschema:"document id or any docs.google.com URL"`
	Ops            []TableOpInput `` /* 254-byte string literal not displayed */
	Mode           string         `json:"mode,omitempty" jsonschema:"suggest, direct or comment; default from get_document capabilities"`
	DryRun         bool           `json:"dry_run,omitempty"`
	ExpectRevision string         `json:"expect_revision,omitempty"`
	Force          bool           `` /* 137-byte string literal not displayed */
}

TableInput is the edit_table call.

type TableOpInput added in v0.2.0

type TableOpInput struct {
	Op              string         `` /* 189-byte string literal not displayed */
	Table           string         `` /* 133-byte string literal not displayed */
	Location        *LocationInput `json:"location,omitempty" jsonschema:"insert_table: where the table goes (after or before a block, or end of the body)"`
	Rows            int            `json:"rows,omitempty" jsonschema:"insert_table: number of rows"`
	Columns         int            `json:"columns,omitempty" jsonschema:"insert_table: number of columns"`
	Data            [][]string     `` /* 137-byte string literal not displayed */
	StartCell       string         `json:"start_cell,omitempty" jsonschema:"set_cells: the cell where data starts; default r1c1"`
	Cells           []CellInput    `json:"cells,omitempty" jsonschema:"set_cells: individual cells to write"`
	ContentFormat   string         `json:"content_format,omitempty" jsonschema:"markdown (default) or text for verbatim cell content"`
	Row             int            `json:"row,omitempty" jsonschema:"insert_rows: the row (1-based) the new rows go next to"`
	Column          int            `json:"column,omitempty" jsonschema:"insert_columns: the column (1-based) the new columns go next to"`
	Count           int            `` /* 135-byte string literal not displayed */
	Before          bool           `` /* 126-byte string literal not displayed */
	RowNumbers      []int          `json:"row_numbers,omitempty" jsonschema:"delete_rows: the rows to delete; style_rows: the rows to style, 1-based"`
	ColumnNumbers   []int          `` /* 127-byte string literal not displayed */
	WidthPt         *float64       `json:"width_pt,omitempty" jsonschema:"style_columns: column width in points (72 to the inch)"`
	WidthType       string         `json:"width_type,omitempty" jsonschema:"style_columns: even to share the table width equally instead of a fixed width_pt"`
	MinHeightPt     *float64       `json:"min_height_pt,omitempty" jsonschema:"style_rows: least height of the row in points; it still grows for its content"`
	PreventOverflow *bool          `json:"prevent_overflow,omitempty" jsonschema:"style_rows: keep the row from breaking across a page"`
	FromCell        string         `` /* 155-byte string literal not displayed */
	ToCell          string         `json:"to_cell,omitempty" jsonschema:"bottom-right cell of the range; default the same cell"`
	Background      string         `json:"background,omitempty" jsonschema:"style_cells: cell background as #rrggbb, or none"`
	Align           string         `json:"align,omitempty" jsonschema:"style_cells: vertical content alignment TOP, MIDDLE or BOTTOM"`
	PaddingPt       *float64       `json:"padding_pt,omitempty" jsonschema:"style_cells: padding on every side in points"`
	PaddingTopPt    *float64       `json:"padding_top_pt,omitempty" jsonschema:"style_cells: overrides padding_pt on the top side"`
	PaddingBottomPt *float64       `json:"padding_bottom_pt,omitempty"`
	PaddingLeftPt   *float64       `json:"padding_left_pt,omitempty"`
	PaddingRightPt  *float64       `json:"padding_right_pt,omitempty"`
	Border          string         `` /* 207-byte string literal not displayed */
	BorderTop       string         `json:"border_top,omitempty" jsonschema:"style_cells: the top edge alone, same form as border"`
	BorderBottom    string         `json:"border_bottom,omitempty"`
	BorderLeft      string         `json:"border_left,omitempty"`
	BorderRight     string         `json:"border_right,omitempty"`
}

TableOpInput is one edit_table operation.

type TargetInput

type TargetInput struct {
	Text           string `` /* 189-byte string literal not displayed */
	Occurrence     int    `json:"occurrence,omitempty" jsonschema:"which occurrence of text to use when it repeats, 1-based"`
	Within         string `json:"within,omitempty" jsonschema:"restrict a text match to a block handle (p12), a heading_id, or heading:<heading text>"`
	HeadingID      string `` /* 178-byte string literal not displayed */
	Heading        string `json:"heading,omitempty" jsonschema:"a whole section by its heading text (whole heading, case-insensitive)"`
	HeadingLevel   int    `json:"heading_level,omitempty" jsonschema:"only match headings of this level (1-6) with heading"`
	IncludeHeading *bool  `` /* 129-byte string literal not displayed */
	Handle         string `` /* 138-byte string literal not displayed */
	FromHandle     string `json:"from_handle,omitempty" jsonschema:"first block of a whole-block range"`
	ToHandle       string `json:"to_handle,omitempty" jsonschema:"last block of the range, inclusive"`
	Cell           string `json:"cell,omitempty" jsonschema:"the content of one table cell, e.g. tbl1:r2c3"`
	NamedRange     string `` /* 168-byte string literal not displayed */
	Tab            string `json:"tab,omitempty" jsonschema:"tab id, title or number; default the first tab"`
	Segment        string `json:"segment,omitempty" jsonschema:"body (default), header, footer or footnote, optionally numbered"`
}

TargetInput points at content. Set exactly one selector.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL