Skip to main content
Glama

sheets_copy_to

Copy a specific sheet from one Google Sheets spreadsheet to another by specifying source and destination spreadsheet IDs and the sheet ID to transfer.

Instructions

Copy a sheet to another Google Sheets spreadsheet

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
destinationSpreadsheetIdYesThe ID of the destination spreadsheet
sheetIdYesThe ID of the sheet to copy (use sheets_get_metadata to find sheet IDs)
spreadsheetIdYesThe ID of the source spreadsheet (found in the URL after /d/)

Implementation Reference

  • The main execution logic for the sheets_copy_to tool: validates input, uses Google Sheets API to copy the sheet, formats success response, and handles errors.
    export async function handleCopyTo(input: any) {
      try {
        const validatedInput = validateCopyToInput(input);
        const sheets = await getAuthenticatedClient();
    
        const response = await sheets.spreadsheets.sheets.copyTo({
          spreadsheetId: validatedInput.spreadsheetId,
          sheetId: validatedInput.sheetId,
          requestBody: {
            destinationSpreadsheetId: validatedInput.destinationSpreadsheetId,
          },
        });
    
        return formatSheetOperationResponse('Sheet copied', {
          destinationSheetId: response.data.sheetId,
          title: response.data.title,
        });
      } catch (error) {
        return handleError(error);
      }
    }
  • Input schema and metadata definition for the sheets_copy_to tool.
    export const copyToTool: Tool = {
      name: 'sheets_copy_to',
      description: 'Copy a sheet to another Google Sheets spreadsheet',
      inputSchema: {
        type: 'object',
        properties: {
          spreadsheetId: {
            type: 'string',
            description: 'The ID of the source spreadsheet (found in the URL after /d/)',
          },
          sheetId: {
            type: 'number',
            description: 'The ID of the sheet to copy (use sheets_get_metadata to find sheet IDs)',
          },
          destinationSpreadsheetId: {
            type: 'string',
            description: 'The ID of the destination spreadsheet',
          },
        },
        required: ['spreadsheetId', 'sheetId', 'destinationSpreadsheetId'],
      },
    };
  • src/index.ts:45-45 (registration)
    Maps the tool name 'sheets_copy_to' to its handler function in the central toolHandlers registry.
    ['sheets_copy_to', tools.handleCopyTo],
  • src/index.ts:80-80 (registration)
    Includes the copyToTool in the list of all tools returned by ListTools.
    tools.copyToTool,
  • Re-exports the copyToTool and handleCopyTo from copy-to.ts for use in main index.
    export * from './copy-to.js';
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Copy') but doesn't mention whether this requires specific permissions, what happens to the original sheet, if the copy includes formatting/data, or any rate limits/errors. This leaves significant gaps for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any fluff or redundancy. It's appropriately sized and front-loaded, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description is inadequate. It doesn't explain what the tool returns (e.g., the ID of the copied sheet), error conditions, or behavioral details like whether the copy preserves formulas/formatting. Given the complexity and lack of structured data, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with all three parameters clearly documented in the schema itself (e.g., 'sheetId' includes a tip to use 'sheets_get_metadata'). The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Copy a sheet') and the resource ('to another Google Sheets spreadsheet'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'sheets_duplicate_sheet' which might have overlapping functionality, keeping it from a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'sheets_duplicate_sheet' (which might copy within the same spreadsheet) or other sibling tools. It lacks any context about prerequisites, use cases, or exclusions, offering minimal usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/freema/mcp-gsheets'

If you have feedback or need assistance with the MCP directory API, please join our Discord server