smartsheet server

Local 2025-09-01 00:05:29 0

Provides seamless integration with Smartsheet, enabling automated operations on Smartsheet documents through a standardized interface that bridges AI-powered automation tools with Smartsheet's collaboration platform.


A Model Context Protocol (MCP) server that provides seamless integration with Smartsheet, enabling automated operations on Smartsheet documents through a standardized interface. This server bridges the gap between AI-powered automation tools and Smartsheet's powerful collaboration platform.

Overview

The Smartsheet MCP Server is designed to facilitate intelligent interactions with Smartsheet, providing a robust set of tools for document management, data operations, and column customization. It serves as a critical component in automated workflows, enabling AI systems to programmatically interact with Smartsheet data while maintaining data integrity and enforcing business rules.

Key Benefits

  • Intelligent Integration: Seamlessly connects AI systems with Smartsheet's collaboration platform
  • Data Integrity: Enforces validation rules and maintains referential integrity across operations
  • Formula Management: Preserves and updates formula references automatically
  • Flexible Configuration: Supports various column types and complex data structures
  • Error Resilience: Implements comprehensive error handling and validation at multiple layers
  • Healthcare Analytics: Specialized analysis capabilities for clinical and research data
  • Batch Processing: Efficient handling of large healthcare datasets
  • Custom Scoring: Flexible scoring systems for healthcare initiatives and research

Use Cases

  1. Clinical Research Analytics

  2. Protocol compliance scoring

  3. Patient data analysis
  4. Research impact assessment
  5. Clinical trial data processing
  6. Automated research note summarization

  7. Hospital Operations

  8. Resource utilization analysis

  9. Patient satisfaction scoring
  10. Department efficiency metrics
  11. Staff performance analytics
  12. Quality metrics tracking

  13. Healthcare Innovation

  14. Pediatric alignment scoring

  15. Innovation impact assessment
  16. Research prioritization
  17. Implementation feasibility analysis
  18. Clinical value assessment

  19. Automated Document Management

  20. Programmatic sheet structure modifications

  21. Dynamic column creation and management
  22. Automated data validation and formatting

  23. Data Operations

  24. Bulk data updates with integrity checks

  25. Intelligent duplicate detection
  26. Formula-aware modifications

  27. System Integration

  28. AI-driven sheet customization
  29. Automated reporting workflows
  30. Cross-system data synchronization

Integration Points

The server integrates with:

  • Smartsheet API for data operations
  • MCP protocol for standardized communication
  • Local development tools via stdio interface
  • Monitoring systems through structured logging

Architecture

The server implements a bridge architecture between MCP and Smartsheet:

graph LR
    subgraph MCP[MCP Layer]
        direction TB
        A[Client Request] --> B[TypeScript MCP Server]
        B --> C[Tool Registry]
        B --> D[Config Management]
    end

    subgraph CLI[CLI Layer]
        direction TB
        E[Python CLI] --> F[Argument Parser]
        F --> G[Command Router]
        G --> H[JSON Formatter]
    end

    subgraph Core[Core Operations]
        direction TB
        I[Smartsheet API Client] --> J[Column Manager]
        J --> K[Data Validator]
        J --> L[Formula Parser]
    end

    MCP --> CLI --> Core

    style A fill:#f9f,stroke:#333
    style I fill:#bbf,stroke:#333
  1. TypeScript MCP Layer (src/index.ts)

  2. Handles MCP protocol communication

  3. Registers and manages available tools
  4. Routes requests to Python implementation
  5. Manages configuration and error handling

  6. Python CLI Layer (smartsheet_ops/cli.py)

  7. Provides command-line interface for operations

  8. Handles argument parsing and validation
  9. Implements duplicate detection
  10. Manages JSON data formatting

  11. Core Operations Layer (smartsheet_ops/__init__.py)

  12. Implements Smartsheet API interactions
  13. Handles complex column type management
  14. Provides data normalization and validation
  15. Manages system columns and formula parsing

Column Management Flow

sequenceDiagram
    participant C as Client
    participant M as MCP Server
    participant P as Python CLI
    participant S as Smartsheet API

    C->>M: Column Operation Request
    M->>P: Parse & Validate Request

    alt Add Column
        P->>S: Validate Column Limit
        S-->>P: Sheet Info
        P->>S: Create Column
        S-->>P: Column Created
        P->>S: Get Column Details
        S-->>P: Column Info
    else Delete Column
        P->>S: Check Dependencies
        S-->>P: Formula References
        alt Has Dependencies
            P-->>M: Dependency Error
            M-->>C: Cannot Delete
        else No Dependencies
            P->>S: Delete Column
            S-->>P: Success
        end
    else Rename Column
        P->>S: Check Name Uniqueness
        S-->>P: Validation Result
        P->>S: Update Column Name
        S-->>P: Name Updated
        P->>S: Update Formula References
        S-->>P: References Updated
    end

    P-->>M: Operation Result
    M-->>C: Formatted Response

Error Handling Flow

flowchart TD
    A[Client Request] --> B{MCP Layer}
    B -->|Validation Error| C[Return Error Response]
    B -->|Valid Request| D{CLI Layer}

    D -->|Parse Error| E[Format JSON Error]
    D -->|Valid Command| F{Core Operations}

    F -->|API Error| G[Handle API Exception]
    F -->|Validation Error| H[Check Error Type]
    F -->|Success| I[Format Success Response]

    H -->|Dependencies| J[Return Dependency Info]
    H -->|Limits| K[Return Limit Error]
    H -->|Data| L[Return Validation Details]

    G --> M[Format Error Response]
    J --> N[Send to Client]
    K --> N
    L --> N
    I --> N

    style A fill:#f9f,stroke:#333
    style N fill:#bbf,stroke:#333

Features

Tools

  1. get_column_map (Read)

  2. Retrieves column mapping and sample data from a Smartsheet

  3. Provides detailed column metadata including:
    • Column types (system columns, formulas, picklists)
    • Validation rules
    • Format specifications
    • Auto-number configurations
  4. Returns sample data for context
  5. Includes usage examples for writing data

  6. smartsheet_write (Create)

  7. Writes new rows to Smartsheet with intelligent handling of:

    • System-managed columns
    • Multi-select picklist values
    • Formula-based columns
  8. Implements automatic duplicate detection
  9. Returns detailed operation results including row IDs

  10. smartsheet_update (Update)

  11. Updates existing rows in a Smartsheet

  12. Supports partial updates (modify specific fields)
  13. Maintains data integrity with validation
  14. Handles multi-select fields consistently
  15. Returns success/failure details per row

  16. smartsheet_delete (Delete)

  17. Deletes rows from a Smartsheet

  18. Supports batch deletion of multiple rows
  19. Validates row existence and permissions
  20. Returns detailed operation results

  21. smartsheet_add_column (Column Management)

  22. Adds new columns to a Smartsheet

  23. Supports all column types:
    • TEXT_NUMBER
    • DATE
    • CHECKBOX
    • PICKLIST
    • CONTACT_LIST
  24. Configurable options:
    • Position index
    • Validation rules
    • Formula definitions
    • Picklist options
  25. Enforces column limit (400) with validation
  26. Returns detailed column information

  27. smartsheet_delete_column (Column Management)

  28. Safely deletes columns with dependency checking

  29. Validates formula references before deletion
  30. Prevents deletion of columns used in formulas
  31. Returns detailed dependency information
  32. Supports force deletion option

  33. smartsheet_rename_column (Column Management)

  34. Renames columns while preserving relationships

  35. Updates formula references automatically
  36. Maintains data integrity
  37. Validates name uniqueness
  38. Returns detailed update information

  39. smartsheet_bulk_update (Conditional Updates)

  40. Performs conditional bulk updates based on rules

  41. Supports complex condition evaluation:
    • Multiple operators (equals, contains, greaterThan, etc.)
    • Type-specific comparisons (text, dates, numbers)
    • Empty/non-empty checks
  42. Batch processing with configurable size
  43. Comprehensive error handling and rollback
  44. Detailed operation results tracking

  45. start_batch_analysis (Healthcare Analytics)

  46. Processes entire sheets or selected rows with AI analysis

  47. Supports multiple analysis types:
    • Summarization of clinical notes
    • Sentiment analysis of patient feedback
    • Custom scoring for healthcare initiatives
    • Research impact assessment
  48. Features:

    • Automatic batch processing (50 rows per batch)
    • Progress tracking and status monitoring
    • Error handling with detailed reporting
    • Customizable analysis goals
    • Support for multiple source columns
  49. get_job_status (Analysis Monitoring)

    • Tracks batch analysis progress
    • Provides detailed job statistics:
    • Total rows to process
    • Processed row count
    • Failed row count
    • Processing timestamps
    • Real-time status updates
    • Comprehensive error reporting
  50. cancel_batch_analysis (Job Control)

    • Cancels running batch analysis jobs
    • Graceful process termination
    • Maintains data consistency
    • Returns final job status

Key Capabilities

  • Column Type Management

  • Handles system column types (AUTO_NUMBER, CREATED_DATE, etc.)

  • Supports formula parsing and dependency tracking
  • Manages picklist options and multi-select values
  • Comprehensive column operations (add, delete, rename)
  • Formula reference preservation and updates

  • Data Validation

  • Automatic duplicate detection

  • Column type validation
  • Data format verification
  • Column dependency analysis
  • Name uniqueness validation

  • Metadata Handling

  • Extracts and processes column metadata

  • Handles validation rules
  • Manages format specifications
  • Tracks formula dependencies
  • Maintains column relationships

  • Healthcare Analytics

  • Clinical note summarization

  • Patient feedback sentiment analysis
  • Protocol compliance scoring
  • Research impact assessment
  • Resource utilization analysis

  • Batch Processing

  • Automatic row batching (50 rows per batch)

  • Progress tracking and monitoring
  • Error handling and recovery
  • Customizable processing goals
  • Multi-column analysis support

  • Job Management

  • Real-time status monitoring
  • Detailed progress tracking
  • Error reporting and logging
  • Job cancellation support
  • Batch operation controls

Setup

Prerequisites

  • Node.js and npm
  • Conda (for environment management)
  • Smartsheet API access token

Environment Setup

  1. Create a dedicated conda environment:
conda create -n cline_mcp_env python=3.12 nodejs -y
conda activate cline_mcp_env
  1. Install Node.js dependencies:
npm install
  1. Install Python package:
cd smartsheet_ops
pip install -e .
cd ..
  1. Build the TypeScript server:
npm run build

Configuration

The server requires proper configuration in your MCP settings. You can use it with both Claude Desktop and Cline.

1. Get Your Smartsheet API Key

  1. Log in to Smartsheet
  2. Go to Account → Personal Settings → API Access
  3. Generate a new access token

2. Configure for Cline

The configuration path depends on your operating system:

macOS:

~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

Windows:

%APPDATA%CodeUserglobalStoragesaoudrizwan.claude-devsettingscline_mcp_settings.json

Linux:

~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
{
  "mcpServers": {
    "smartsheet": {
      "command": "/Users/[username]/anaconda3/envs/cline_mcp_env/bin/node",
      "args": ["/path/to/smartsheet-server/build/index.js"],
      "env": {
        "PYTHON_PATH": "/Users/[username]/anaconda3/envs/cline_mcp_env/bin/python3",
        "SMARTSHEET_API_KEY": "your-api-key",
        "AZURE_OPENAI_API_KEY": "your-azure-openai-key",
        "AZURE_OPENAI_API_BASE": "your-azure-openai-endpoint",
        "AZURE_OPENAI_API_VERSION": "your-api-version",
        "AZURE_OPENAI_DEPLOYMENT": "your-deployment-name"
      },
      "disabled": false,
      "autoApprove": [
        "get_column_map",
        "smartsheet_write",
        "smartsheet_update",
        "smartsheet_delete",
        "smartsheet_search",
        "smartsheet_add_column",
        "smartsheet_delete_column",
        "smartsheet_rename_column",
        "smartsheet_bulk_update",
        "start_batch_analysis",
        "get_job_status",
        "cancel_batch_analysis"
      ]
    }
  }
}

3. Configure for Claude Desktop (Optional)

The configuration path depends on your operating system:

macOS:

~/Library/Application Support/Claude/claude_desktop_config.json

Windows:

%APPDATA%Claudeclaude_desktop_config.json

Linux:

~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "smartsheet": {
      "command": "/Users/[username]/anaconda3/envs/cline_mcp_env/bin/node",
      "args": ["/path/to/smartsheet-server/build/index.js"],
      "env": {
        "PYTHON_PATH": "/Users/[username]/anaconda3/envs/cline_mcp_env/bin/python3",
        "SMARTSHEET_API_KEY": "your-api-key",
        "AZURE_OPENAI_API_KEY": "your-azure-openai-key",
        "AZURE_OPENAI_API_BASE": "your-azure-openai-endpoint",
        "AZURE_OPENAI_API_VERSION": "your-api-version",
        "AZURE_OPENAI_DEPLOYMENT": "your-deployment-name"
      },
      "disabled": false,
      "autoApprove": [
        "get_column_map",
        "smartsheet_write",
        "smartsheet_update",
        "smartsheet_delete",
        "smartsheet_search",
        "smartsheet_add_column",
        "smartsheet_delete_column",
        "smartsheet_rename_column",
        "smartsheet_bulk_update",
        "start_batch_analysis",
        "get_job_status",
        "cancel_batch_analysis"
      ]
    }
  }
}

Starting the Server

The server will start automatically when Cline or Claude Desktop needs it. However, you can also start it manually for testing.

macOS/Linux:

# Activate the environment
conda activate cline_mcp_env

# Start the server
PYTHON_PATH=/Users/[username]/anaconda3/envs/cline_mcp_env/bin/python3 SMARTSHEET_API_KEY=your-api-key node build/index.js

Windows:

:: Activate the environment
conda activate cline_mcp_env

:: Start the server
set PYTHON_PATH=C:Users[username]anaconda3envscline_mcp_envpython.exe
set SMARTSHEET_API_KEY=your-api-key
node buildindex.js

Verifying Installation

  1. The server should output "Smartsheet MCP server running on stdio" when started
  2. Test the connection using any MCP tool (e.g., get_column_map)
  3. Check the Python environment has the smartsheet package installed:
    conda activate cline_mcp_env
    pip show smartsheet-python-sdk

Usage Examples

Getting Column Information (Read)

// Get column mapping and sample data
const result = await use_mcp_tool({
  server_name: "smartsheet",
  tool_name: "get_column_map",
  arguments: {
    sheet_id: "your-sheet-id",
  },
});

Writing Data (Create)

// Write new rows to Smartsheet
const result = await use_mcp_tool({
  server_name: "smartsheet",
  tool_name: "smartsheet_write",
  arguments: {
    sheet_id: "your-sheet-id",
    column_map: {
      "Column 1": "1234567890",
      "Column 2": "0987654321",
    },
    row_data: [
      {
        "Column 1": "Value 1",
        "Column 2": "Value 2",
      },
    ],
  },
});

Updating Data (Update)

// Update existing rows
const result = await use_mcp_tool({
  server_name: "smartsheet",
  tool_name: "smartsheet_update",
  arguments: {
    sheet_id: "your-sheet-id",
    column_map: {
      Status: "850892021780356",
      Notes: "6861293012340612",
    },
    updates: [
      {
        row_id: "7670198317295492",
        data: {
          Status: "In Progress",
          Notes: "Updated via MCP server",
        },
      },
    ],
  },
});

Deleting Data (Delete)

// Delete rows from Smartsheet
const result = await use_mcp_tool({
  server_name: "smartsheet",
  tool_name: "smartsheet_delete",
  arguments: {
    sheet_id: "your-sheet-id",
    row_ids: ["7670198317295492", "7670198317295493"],
  },
});

Healthcare Analytics Examples

// Example 1: Pediatric Innovation Scoring
const result = await use_mcp_tool({
  server_name: "smartsheet",
  tool_name: "start_batch_analysis",
  arguments: {
    sheet_id: "your-sheet-id",
    type: "custom",
    sourceColumns: ["Ideas", "Implementation_Details"],
    targetColumn: "Pediatric_Score",
    customGoal:
      "Score each innovation 1-100 based on pediatric healthcare impact. Consider: 1) Direct benefit to child patients, 2) Integration with pediatric workflows, 3) Implementation feasibility in children's hospital, 4) Safety considerations for pediatric use. Return only a number.",
  },
});

// Example 2: Clinical Note Summarization
const result = await use_mcp_tool({
  server_name: "smartsheet",
  tool_name: "start_batch_analysis",
  arguments: {
    sheet_id: "your-sheet-id",
    type: "summarize",
    sourceColumns: ["Clinical_Notes"],
    targetColumn: "Note_Summary",
  },
});

// Example 3: Patient Satisfaction Analysis
const result = await use_mcp_tool({
  server_name: "smartsheet",
  tool_name: "start_batch_analysis",
  arguments: {
    sheet_id: "your-sheet-id",
    type: "sentiment",
    sourceColumns: ["Patient_Feedback"],
    targetColumn: "Satisfaction_Score",
  },
});

// Example 4: Protocol Compliance Scoring
const result = await use_mcp_tool({
  server_name: "smartsheet",
  tool_name: "start_batch_analysis",
  arguments: {
    sheet_id: "your-sheet-id",
    type: "custom",
    sourceColumns: ["Protocol_Steps", "Documentation", "Outcomes"],
    targetColumn: "Compliance_Score",
    customGoal:
      "Score protocol compliance 1-100. Consider: 1) Adherence to required steps, 2) Documentation completeness, 3) Safety measures followed, 4) Outcome reporting. Return only a number.",
  },
});

// Example 5: Research Impact Assessment
const result = await use_mcp_tool({
  server_name: "smartsheet",
  tool_name: "start_batch_analysis",
  arguments: {
    sheet_id: "your-sheet-id",
    type: "custom",
    sourceColumns: ["Research_Findings", "Clinical_Applications"],
    targetColumn: "Impact_Score",
    customGoal:
      "Score research impact 1-100 based on potential benefit to pediatric healthcare. Consider: 1) Clinical relevance, 2) Implementation potential, 3) Patient outcome improvement, 4) Cost-effectiveness. Return only a number.",
  },
});

// Monitor Analysis Progress
const status = await use_mcp_tool({
  server_name: "smartsheet",
  tool_name: "get_job_status",
  arguments: {
    sheet_id: "your-sheet-id",
    jobId: "job-id-from-start-analysis",
  },
});

// Cancel Analysis if Needed
const cancel = await use_mcp_tool({
  server_name: "smartsheet",
  tool_name: "cancel_batch_analysis",
  arguments: {
    sheet_id: "your-sheet-id",
    jobId: "job-id-to-cancel",
  },
});

Managing Columns

// Add a new column
const result = await use_mcp_tool({
  server_name: "smartsheet",
  tool_name: "smartsheet_add_column",
  arguments: {
    sheet_id: "your-sheet-id",
    title: "New Column",
    type: "TEXT_NUMBER",
    index: 2, // Optional position
    validation: true, // Optional
    formula: "=[Column1]+ [Column2]", // Optional
  },
});

// Delete a column
const result = await use_mcp_tool({
  server_name: "smartsheet",
  tool_name: "smartsheet_delete_column",
  arguments: {
    sheet_id: "your-sheet-id",
    column_id: "1234567890",
    validate_dependencies: true, // Optional, default true
  },
});

// Rename a column
const result = await use_mcp_tool({
  server_name: "smartsheet",
  tool_name: "smartsheet_rename_column",
  arguments: {
    sheet_id: "your-sheet-id",
    column_id: "1234567890",
    new_title: "Updated Column Name",
    update_references: true, // Optional, default true
  },
});

### Conditional Bulk Updates

The `smartsheet_bulk_update` tool provides powerful conditional update capabilities. Here are examples ranging from simple to complex:

#### Simple Condition Examples

```typescript
// Example 1: Basic equals comparison
const result = await use_mcp_tool({
  server_name: "smartsheet",
  tool_name: "smartsheet_bulk_update",
  arguments: {
    sheet_id: "your-sheet-id",
    rules: [{
      conditions: [{
        columnId: "status-column-id",
        operator: "equals",
        value: "Pending"
      }],
      updates: [{
        columnId: "status-column-id",
        value: "In Progress"
      }]
    }]
  }
});

// Example 2: Contains text search
const result = await use_mcp_tool({
  server_name: "smartsheet",
  tool_name: "smartsheet_bulk_update",
  arguments: {
    sheet_id: "your-sheet-id",
    rules: [{
      conditions: [{
        columnId: "description-column-id",
        operator: "contains",
        value: "urgent"
      }],
      updates: [{
        columnId: "priority-column-id",
        value: "High"
      }]
    }]
  }
});

// Example 3: Empty value check
const result = await use_mcp_tool({
  server_name: "smartsheet",
  tool_name: "smartsheet_bulk_update",
  arguments: {
    sheet_id: "your-sheet-id",
    rules: [{
      conditions: [{
        columnId: "assignee-column-id",
        operator: "isEmpty"
      }],
      updates: [{
        columnId: "status-column-id",
        value: "Unassigned"
      }]
    }]
  }
});

Type-Specific Comparisons

// Example 1: Date comparison
const result = await use_mcp_tool({
  server_name: "smartsheet",
  tool_name: "smartsheet_bulk_update",
  arguments: {
    sheet_id: "your-sheet-id",
    rules: [
      {
        conditions: [
          {
            columnId: "due-date-column-id",
            operator: "lessThan",
            value: "2025-02-01T00:00:00Z", // ISO date format
          },
        ],
        updates: [
          {
            columnId: "status-column-id",
            value: "Due Soon",
          },
        ],
      },
    ],
  },
});

// Example 2: Numeric comparison
const result = await use_mcp_tool({
  server_name: "smartsheet",
  tool_name: "smartsheet_bulk_update",
  arguments: {
    sheet_id: "your-sheet-id",
    rules: [
      {
        conditions: [
          {
            columnId: "progress-column-id",
            operator: "greaterThan",
            value: 80, // Numeric value
          },
        ],
        updates: [
          {
            columnId: "status-column-id",
            value: "Nearly Complete",
          },
        ],
      },
    ],
  },
});

// Example 3: Picklist validation
const result = await use_mcp_tool({
  server_name: "smartsheet",
  tool_name: "smartsheet_bulk_update",
  arguments: {
    sheet_id: "your-sheet-id",
    rules: [
      {
        conditions: [
          {
            columnId: "category-column-id",
            operator: "equals",
            value: "Bug", // Must match picklist option exactly
          },
        ],
        updates: [
          {
            columnId: "priority-column-id",
            value: "High",
          },
        ],
      },
    ],
  },
});

Complex Multi-Condition Examples

// Example 1: Multiple conditions with different operators
const result = await use_mcp_tool({
  server_name: "smartsheet",
  tool_name: "smartsheet_bulk_update",
  arguments: {
    sheet_id: "your-sheet-id",
    rules: [
      {
        conditions: [
          {
            columnId: "priority-column-id",
            operator: "equals",
            value: "High",
          },
          {
            columnId: "due-date-column-id",
            operator: "lessThan",
            value: "2025-02-01T00:00:00Z",
          },
          {
            columnId: "progress-column-id",
            operator: "lessThan",
            value: 50,
          },
        ],
        updates: [
          {
            columnId: "status-column-id",
            value: "At Risk",
          },
          {
            columnId: "flag-column-id",
            value: true,
          },
        ],
      },
    ],
  },
});

// Example 2: Multiple rules with batch processing
const result = await use_mcp_tool({
  server_name: "smartsheet",
  tool_name: "smartsheet_bulk_update",
  arguments: {
    sheet_id: "your-sheet-id",
    rules: [
      {
        conditions: [
          {
            columnId: "status-column-id",
            operator: "equals",
            value: "Complete",
          },
          {
            columnId: "qa-status-column-id",
            operator: "isEmpty",
          },
        ],
        updates: [
          {
            columnId: "qa-status-column-id",
            value: "Ready for QA",
          },
        ],
      },
      {
        conditions: [
          {
            columnId: "status-column-id",
            operator: "equals",
            value: "In Progress",
          },
          {
            columnId: "progress-column-id",
            operator: "equals",
            value: 100,
          },
        ],
        updates: [
          {
            columnId: "status-column-id",
            value: "Complete",
          },
        ],
      },
    ],
    options: {
      lenientMode: true, // Continue on errors
      batchSize: 100, // Process in smaller batches
    },
  },
});

The bulk update operation provides:

  1. Operator Support:

  2. equals: Exact value matching

  3. contains: Substring matching
  4. greaterThan: Numeric/date comparison
  5. lessThan: Numeric/date comparison
  6. isEmpty: Null/empty check
  7. isNotEmpty: Present value check

  8. Type-Specific Features:

  9. TEXT_NUMBER: String/numeric comparisons

  10. DATE: ISO date parsing and comparison
  11. PICKLIST: Option validation
  12. CHECKBOX: Boolean handling

  13. Processing Options:

  14. batchSize: Control update batch size (default 500)

  15. lenientMode: Continue on errors
  16. Multiple rules per request
  17. Multiple updates per rule

  18. Result Tracking:

  19. Total rows attempted
  20. Success/failure counts
  21. Detailed error information
  22. Per-row failure details

## Development

For development with auto-rebuild:

```bash
npm run watch

Debugging

Since MCP servers communicate over stdio, debugging can be challenging. The server implements comprehensive error logging and provides detailed error messages through the MCP protocol.

Key debugging features:

  • Error logging to stderr
  • Detailed error messages in MCP responses
  • Type validation at multiple levels
  • Comprehensive operation result reporting
  • Dependency analysis for column operations
  • Formula reference tracking

Error Handling

The server implements a multi-layer error handling approach:

  1. MCP Layer

  2. Validates tool parameters

  3. Handles protocol-level errors
  4. Provides formatted error responses
  5. Manages timeouts and retries

  6. CLI Layer

  7. Validates command arguments

  8. Handles execution errors
  9. Formats error messages as JSON
  10. Validates column operations

  11. Operations Layer

  12. Handles Smartsheet API errors
  13. Validates data types and formats
  14. Provides detailed error context
  15. Manages column dependencies
  16. Validates formula references
  17. Ensures data integrity

Contributing

Contributions are welcome! Please ensure:

  1. TypeScript/Python code follows existing style
  2. New features include appropriate error handling
  3. Changes maintain backward compatibility
  4. Updates include appropriate documentation
  5. Column operations maintain data integrity
  6. Formula references are properly handled
[
  {
    "description": "Add a new column to a Smartsheet",
    "inputSchema": {
      "properties": {
        "formula": {
          "description": "Formula for calculated columns",
          "type": "string"
        },
        "index": {
          "description": "Optional position index",
          "type": "number"
        },
        "options": {
          "description": "Options for PICKLIST type",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "sheet_id": {
          "description": "Smartsheet sheet ID",
          "type": "string"
        },
        "title": {
          "description": "Column title",
          "type": "string"
        },
        "type": {
          "description": "Column type",
          "enum": [
            "TEXT_NUMBER",
            "DATE",
            "CHECKBOX",
            "PICKLIST",
            "CONTACT_LIST"
          ],
          "type": "string"
        },
        "validation": {
          "description": "Enable validation",
          "type": "boolean"
        }
      },
      "required": [
        "sheet_id",
        "title",
        "type"
      ],
      "type": "object"
    },
    "name": "smartsheet_add_column"
  },
  {
    "description": "Delete a column from a Smartsheet",
    "inputSchema": {
      "properties": {
        "column_id": {
          "description": "Column ID to delete",
          "type": "string"
        },
        "sheet_id": {
          "description": "Smartsheet sheet ID",
          "type": "string"
        },
        "validate_dependencies": {
          "default": true,
          "description": "Check for formula/dependency impacts",
          "type": "boolean"
        }
      },
      "required": [
        "sheet_id",
        "column_id"
      ],
      "type": "object"
    },
    "name": "smartsheet_delete_column"
  },
  {
    "description": "Rename a column in a Smartsheet",
    "inputSchema": {
      "properties": {
        "column_id": {
          "description": "Column ID to rename",
          "type": "string"
        },
        "new_title": {
          "description": "New column title",
          "type": "string"
        },
        "sheet_id": {
          "description": "Smartsheet sheet ID",
          "type": "string"
        },
        "update_references": {
          "default": true,
          "description": "Update formulas referencing this column",
          "type": "boolean"
        }
      },
      "required": [
        "sheet_id",
        "column_id",
        "new_title"
      ],
      "type": "object"
    },
    "name": "smartsheet_rename_column"
  },
  {
    "description": "Get column mapping and sample data from a Smartsheet",
    "inputSchema": {
      "properties": {
        "sheet_id": {
          "description": "Smartsheet sheet ID",
          "type": "string"
        }
      },
      "required": [
        "sheet_id"
      ],
      "type": "object"
    },
    "name": "get_column_map"
  },
  {
    "description": "Write data to a Smartsheet",
    "inputSchema": {
      "properties": {
        "column_map": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Object mapping data fields to Smartsheet column IDs",
          "type": "object"
        },
        "row_data": {
          "description": "Array of objects containing the data to write",
          "items": {
            "type": "object"
          },
          "type": "array"
        },
        "sheet_id": {
          "description": "Smartsheet sheet ID",
          "type": "string"
        }
      },
      "required": [
        "sheet_id",
        "row_data",
        "column_map"
      ],
      "type": "object"
    },
    "name": "smartsheet_write"
  },
  {
    "description": "Update existing rows in a Smartsheet",
    "inputSchema": {
      "properties": {
        "column_map": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Object mapping data fields to Smartsheet column IDs",
          "type": "object"
        },
        "sheet_id": {
          "description": "Smartsheet sheet ID",
          "type": "string"
        },
        "updates": {
          "description": "Array of updates containing row_id and data",
          "items": {
            "properties": {
              "data": {
                "description": "Data to update in the row",
                "type": "object"
              },
              "row_id": {
                "description": "Row ID to update",
                "type": "string"
              }
            },
            "required": [
              "row_id",
              "data"
            ],
            "type": "object"
          },
          "type": "array"
        }
      },
      "required": [
        "sheet_id",
        "updates",
        "column_map"
      ],
      "type": "object"
    },
    "name": "smartsheet_update"
  },
  {
    "description": "Delete rows from a Smartsheet",
    "inputSchema": {
      "properties": {
        "row_ids": {
          "description": "Array of row IDs to delete",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "sheet_id": {
          "description": "Smartsheet sheet ID",
          "type": "string"
        }
      },
      "required": [
        "sheet_id",
        "row_ids"
      ],
      "type": "object"
    },
    "name": "smartsheet_delete"
  },
  {
    "description": "Search for content in a Smartsheet",
    "inputSchema": {
      "properties": {
        "options": {
          "description": "Search options",
          "properties": {
            "case_sensitive": {
              "description": "Case sensitive search (default: false)",
              "type": "boolean"
            },
            "columns": {
              "description": "Specific columns to search (default: all)",
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "include_system": {
              "description": "Include system-managed columns (default: false)",
              "type": "boolean"
            },
            "regex": {
              "description": "Use regex pattern matching (default: false)",
              "type": "boolean"
            },
            "whole_word": {
              "description": "Match whole words only (default: false)",
              "type": "boolean"
            }
          },
          "type": "object"
        },
        "pattern": {
          "description": "Search pattern (text or regex)",
          "type": "string"
        },
        "sheet_id": {
          "description": "Smartsheet sheet ID",
          "type": "string"
        }
      },
      "required": [
        "sheet_id",
        "pattern"
      ],
      "type": "object"
    },
    "name": "smartsheet_search"
  },
  {
    "description": "Start a batch analysis job using Azure OpenAI",
    "inputSchema": {
      "properties": {
        "customGoal": {
          "description": "Custom analysis goal for custom analysis type",
          "type": "string"
        },
        "rowIds": {
          "description": "Rows to process",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "sheet_id": {
          "description": "Smartsheet sheet ID",
          "type": "string"
        },
        "sourceColumns": {
          "description": "Columns to analyze",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "targetColumn": {
          "description": "Column to store results",
          "type": "string"
        },
        "type": {
          "description": "Analysis type",
          "enum": [
            "summarize",
            "sentiment",
            "interpret",
            "custom"
          ],
          "type": "string"
        }
      },
      "required": [
        "sheet_id",
        "type",
        "sourceColumns",
        "targetColumn",
        "rowIds"
      ],
      "type": "object"
    },
    "name": "start_batch_analysis"
  },
  {
    "description": "Cancel a running batch analysis job",
    "inputSchema": {
      "properties": {
        "jobId": {
          "description": "Job to cancel",
          "type": "string"
        },
        "sheet_id": {
          "description": "Smartsheet sheet ID",
          "type": "string"
        }
      },
      "required": [
        "sheet_id",
        "jobId"
      ],
      "type": "object"
    },
    "name": "cancel_batch_analysis"
  },
  {
    "description": "Get the status of a batch analysis job",
    "inputSchema": {
      "properties": {
        "jobId": {
          "description": "Job to check status for",
          "type": "string"
        },
        "sheet_id": {
          "description": "Smartsheet sheet ID",
          "type": "string"
        }
      },
      "required": [
        "sheet_id",
        "jobId"
      ],
      "type": "object"
    },
    "name": "get_job_status"
  },
  {
    "description": "Perform conditional bulk updates on a Smartsheet",
    "inputSchema": {
      "properties": {
        "options": {
          "description": "Update options",
          "properties": {
            "batchSize": {
              "default": 500,
              "description": "Number of rows per batch",
              "type": "number"
            },
            "lenientMode": {
              "default": false,
              "description": "Allow partial success",
              "type": "boolean"
            }
          },
          "type": "object"
        },
        "rules": {
          "description": "List of update rules",
          "items": {
            "properties": {
              "conditions": {
                "description": "Conditions to evaluate (AND logic)",
                "items": {
                  "properties": {
                    "columnId": {
                      "description": "Column ID to check",
                      "type": "string"
                    },
                    "operator": {
                      "description": "Comparison operator",
                      "enum": [
                        "equals",
                        "contains",
                        "greaterThan",
                        "lessThan",
                        "isEmpty",
                        "isNotEmpty"
                      ],
                      "type": "string"
                    },
                    "value": {
                      "description": "Value to compare against (not needed for isEmpty/isNotEmpty)",
                      "type": [
                        "string",
                        "number",
                        "boolean",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "columnId",
                    "operator"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "updates": {
                "description": "Updates to apply when conditions are met",
                "items": {
                  "properties": {
                    "columnId": {
                      "description": "Column ID to update",
                      "type": "string"
                    },
                    "value": {
                      "description": "New value to set",
                      "type": [
                        "string",
                        "number",
                        "boolean",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "columnId",
                    "value"
                  ],
                  "type": "object"
                },
                "type": "array"
              }
            },
            "required": [
              "conditions",
              "updates"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "sheet_id": {
          "description": "Smartsheet sheet ID",
          "type": "string"
        }
      },
      "required": [
        "sheet_id",
        "rules"
      ],
      "type": "object"
    },
    "name": "smartsheet_bulk_update"
  }
]