Skip to main content
Glama
mohalmah

Google Apps Script MCP Server

by mohalmah

script_projects_deployments_get

Retrieve a specific deployment of a Google Apps Script project using its script and deployment IDs to access deployment details.

Instructions

Get a deployment of an Apps Script project.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptIdYesThe ID of the script project.
deploymentIdYesThe ID of the deployment to retrieve.

Implementation Reference

  • Main handler function that executes the logic to retrieve a specific Apps Script project deployment via the Google API using OAuth authentication, with comprehensive error handling.
    const executeFunction = async ({ scriptId, deploymentId }) => {
      const baseUrl = 'https://script.googleapis.com';
      const url = `${baseUrl}/v1/projects/${scriptId}/deployments/${deploymentId}`;
    
      try {
        // Get OAuth access token
        const token = await getOAuthAccessToken();
        
        // Set up headers for the request
        const headers = {
          'Authorization': `Bearer ${token}`,
          'Accept': 'application/json'
        };
    
        // Perform the fetch request
        const response = await fetch(url, {
          method: 'GET',
          headers
        });
    
        // Check if the response was successful
        if (!response.ok) {
          const errorText = await response.text();
          console.error('API Error Response:', errorText);
          throw new Error(`HTTP ${response.status}: ${errorText}`);
        }
    
        // Parse and return the response data
        const data = await response.json();
        return data;
      } catch (error) {
        const errorDetails = {
          message: error.message,
          stack: error.stack,
          scriptId,
          deploymentId,
          timestamp: new Date().toISOString(),
          errorType: error.name || 'Unknown'
        };
    
        logger.error('DEPLOYMENT_GET', 'Error retrieving deployment', errorDetails);
        
        console.error('❌ Error retrieving deployment:', errorDetails);
        
        // Return detailed error information for debugging
        return { 
          error: true,
          message: error.message,
          details: errorDetails,
          rawError: {
            name: error.name,
            stack: error.stack
          }
        };
      }
    };
  • JSON schema defining the tool's name, description, input parameters (scriptId and deploymentId as required strings), used for MCP tool validation.
      name: 'script_projects_deployments_get',
      description: 'Get a deployment of an Apps Script project.',
      parameters: {
        type: 'object',
        properties: {
          scriptId: {
            type: 'string',
            description: 'The ID of the script project.'
          },
          deploymentId: {
            type: 'string',
            description: 'The ID of the deployment to retrieve.'
          }
        },
        required: ['scriptId', 'deploymentId']
      }
    }
  • The apiTool object that registers the handler function and schema definition for the MCP tool system, exported for import into central tool registry.
    const apiTool = {
      function: executeFunction,
      definition: {
        type: 'function',
        function: {
          name: 'script_projects_deployments_get',
          description: 'Get a deployment of an Apps Script project.',
          parameters: {
            type: 'object',
            properties: {
              scriptId: {
                type: 'string',
                description: 'The ID of the script project.'
              },
              deploymentId: {
                type: 'string',
                description: 'The ID of the deployment to retrieve.'
              }
            },
            required: ['scriptId', 'deploymentId']
          }
        }
      }
    };
  • Path listing used likely for dynamic import and registration of all Apps Script API tools in the MCP system.
    'google-app-script-api/apps-script-api/script-projects-deployments-get.js',
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. While 'Get' implies a read operation, it doesn't specify whether this requires authentication, returns specific data formats, has rate limits, or handles errors. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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 unnecessary words. It's appropriately front-loaded and earns its place by clearly communicating the core functionality.

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?

Given the lack of annotations and output schema, the description is insufficiently complete. It doesn't explain what a 'deployment' entails in this context, what data is returned, or any prerequisites for successful execution. For a retrieval tool in a complex domain (Apps Script projects), more contextual information would be helpful.

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?

Schema description coverage is 100%, with both parameters clearly documented in the schema. The description doesn't add any meaningful parameter context beyond what the schema already provides, so it meets the baseline expectation without compensating value.

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 ('Get') and resource ('deployment of an Apps Script project'), making the purpose immediately understandable. However, it doesn't distinguish this tool from potential siblings like 'script_projects_deployments_list' or 'script_projects_versions_get' which might retrieve related but different resources.

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. With siblings like 'script_projects_deployments_list' (likely for listing multiple deployments) and 'script_projects_get' (for retrieving project metadata), the agent must infer usage context without explicit 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

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/mohalmah/google-appscript-mcp-server'

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