import type { Tool } from "@modelcontextprotocol/sdk/types.js";
export const documentTools: Tool[] = [
{
name: "create_document",
description: "Create a new Word document with optional title",
inputSchema: {
type: "object",
properties: {
filepath: {
type: "string",
description: "Full path where document will be saved (e.g., /path/to/document.docx)",
},
title: {
type: "string",
description: "Optional title for the document",
},
},
required: ["filepath"],
},
},
{
name: "add_heading",
description: "Add a heading to the document at specified level (1-5)",
inputSchema: {
type: "object",
properties: {
docId: {
type: "string",
description: "Document identifier",
},
text: {
type: "string",
description: "Heading text",
},
level: {
type: "number",
description: "Heading level (1=Heading1, 2=Heading2, etc.)",
minimum: 1,
maximum: 5,
},
},
required: ["docId", "text", "level"],
},
},
{
name: "add_paragraph",
description: "Add a paragraph of text to the document",
inputSchema: {
type: "object",
properties: {
docId: {
type: "string",
description: "Document identifier",
},
text: {
type: "string",
description: "Paragraph text",
},
formatting: {
type: "object",
description: "Optional formatting options",
properties: {
bold: { type: "boolean" },
italic: { type: "boolean" },
underline: { type: "boolean" },
fontSize: { type: "number" },
font: { type: "string" },
color: { type: "string", description: "Hex color (e.g., FF0000 for red)" },
alignment: {
type: "string",
enum: ["left", "center", "right", "justified"],
},
},
},
},
required: ["docId", "text"],
},
},
{
name: "add_bullet_list",
description: "Add a bulleted list to the document",
inputSchema: {
type: "object",
properties: {
docId: {
type: "string",
description: "Document identifier",
},
items: {
type: "array",
items: { type: "string" },
description: "Array of list items",
},
},
required: ["docId", "items"],
},
},
{
name: "add_numbered_list",
description: "Add a numbered list to the document",
inputSchema: {
type: "object",
properties: {
docId: {
type: "string",
description: "Document identifier",
},
items: {
type: "array",
items: { type: "string" },
description: "Array of list items",
},
},
required: ["docId", "items"],
},
},
{
name: "add_table",
description: "Add a table to the document",
inputSchema: {
type: "object",
properties: {
docId: {
type: "string",
description: "Document identifier",
},
headers: {
type: "array",
items: { type: "string" },
description: "Table header row",
},
rows: {
type: "array",
items: {
type: "array",
items: { type: "string" },
},
description: "Table data rows",
},
},
required: ["docId", "headers", "rows"],
},
},
{
name: "find_and_replace",
description: "Find and replace text in the document",
inputSchema: {
type: "object",
properties: {
docId: {
type: "string",
description: "Document identifier",
},
findText: {
type: "string",
description: "Text to find",
},
replaceText: {
type: "string",
description: "Text to replace with",
},
replaceAll: {
type: "boolean",
description: "Replace all occurrences (true) or just first (false)",
default: true,
},
},
required: ["docId", "findText", "replaceText"],
},
},
{
name: "save_document",
description: "Save the document to disk",
inputSchema: {
type: "object",
properties: {
docId: {
type: "string",
description: "Document identifier",
},
},
required: ["docId"],
},
},
{
name: "get_document_structure",
description: "Get the structure/outline of the document (headings and paragraphs)",
inputSchema: {
type: "object",
properties: {
docId: {
type: "string",
description: "Document identifier",
},
},
required: ["docId"],
},
},
{
name: "apply_text_formatting",
description: "Apply formatting to specific text in the document",
inputSchema: {
type: "object",
properties: {
docId: {
type: "string",
description: "Document identifier",
},
searchText: {
type: "string",
description: "Text to format",
},
formatting: {
type: "object",
properties: {
bold: { type: "boolean" },
italic: { type: "boolean" },
underline: { type: "boolean" },
highlight: { type: "string", description: "Highlight color" },
},
},
},
required: ["docId", "searchText", "formatting"],
},
},
];