Skip to main content
Glama
netlify

Netlify MCP Server

Official
by netlify

netlify-extension-services-updater

Manages Netlify extension installations and database initialization for sites and teams. Select operations to install or uninstall extensions or initialize databases through the Netlify MCP Server.

Instructions

Select and run one of the following Netlify write operations change-extension-installation, initialize-database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectSchemaYes

Implementation Reference

  • Registers the grouped 'netlify-extension-services-updater' tool (when operationType='write' and domain='extension') including schema (selector union) and dispatching handler logic.
      // Register tools grouped by domain with selector (uses anyOf/union)
      const paramsSchema = {
        // @ts-ignore
        selectSchema: tools.length > 1 ? z.union(tools.map(tool => toSelectorSchema(tool))) : toSelectorSchema(tools[0])
      };
    
      const friendlyOperationType = operationType === 'read' ? 'reader' : 'updater';
      const toolName = `netlify-${domain}-services-${friendlyOperationType}`;
      const toolDescription = `Select and run one of the following Netlify ${operationType} operations${readOnlyIndicator} ${toolOperations.join(', ')}`;
    
      server.registerTool(toolName, {
        description: toolDescription,
        inputSchema: paramsSchema,
        annotations: {
          readOnlyHint: operationType === 'read'
        }
      }, async (...args) => {
        checkCompatibility();
    
        try {
          await getNetlifyAccessToken(remoteMCPRequest);
        } catch (error: NetlifyUnauthError | any) {
          if (error instanceof NetlifyUnauthError && remoteMCPRequest) {
            throw new NetlifyUnauthError();
          }
    
          return {
            content: [{ type: "text", text: error?.message || 'Failed to get Netlify token' }],
            isError: true
          };
        }
    
        appendToLog(`${toolName} operation: ${JSON.stringify(args)}`);
    
        const selectedSchema = args[0]?.selectSchema as any;
    
        if (!selectedSchema) {
          return {
            content: [{ type: "text", text: 'Failed to select a valid operation. Retry the MCP operation but select the operation and provide the right inputs.' }]
          }
        }
    
        const operation = selectedSchema.operation;
    
        const subtool = tools.find(subtool => subtool.operation === operation);
    
        if (!subtool) {
          return {
            content: [{ type: "text", text: 'Agent called the wrong MCP tool for this operation.' }]
          }
        }
    
        const result = await subtool.cb(selectedSchema.params || {}, {request: remoteMCPRequest, isRemoteMCP: !!remoteMCPRequest});
    
        appendToLog(`${domain} operation result: ${JSON.stringify(result)}`);
    
        return {
          content: [{ type: "text", text: JSON.stringify(result) }]
        }
      });
    }
  • Defines the extensionDomainTools array listing all extension tools, from which read/write are categorized and the write ones ('change-extension-installation', 'initialize-database') are grouped under the updater service.
    import { changeExtensionInstallationDomainTool } from './change-extension-installation.js';
    import { getExtensionsDomainTool } from './get-extensions.js';
    import { getFullExtensionDetailsDomainTool } from './get-full-extension-details.js';
    import { initializeDatabaseDomainTool } from './initialize-database.js';
    
    export const extensionDomainTools = [changeExtensionInstallationDomainTool, getExtensionsDomainTool, getFullExtensionDetailsDomainTool, initializeDatabaseDomainTool]
  • Core handler (cb) for the 'change-extension-installation' operation dispatched by netlify-extension-services-updater; handles installing/uninstalling extensions and provides config URLs.
    export const changeExtensionInstallationDomainTool: DomainTool<typeof changeExtensionInstallationParamsSchema> = {
      domain: 'extension',
      operation: 'change-extension-installation',
      inputSchema: changeExtensionInstallationParamsSchema,
      toolAnnotations: {
        readOnlyHint: false,
      },
      cb: async ({ extensionSlug, shouldBeInstalled, teamId, siteId }, {request}) => {
    
        try {
    
          await changeExtensionInstallation({
            shouldBeInstalled,
            accountId: teamId,
            extensionSlug,
            request,
          });
    
          appendToLog(`Extension "${extensionSlug}" successfully ${shouldBeInstalled ? 'installed' : 'uninstalled'} on account "${teamId}"`);
    
          // Check if extension has site-level configuration
          const extensionData = await getExtension({
            accountId: teamId,
            extensionSlug,
            request
          });
    
          if (extensionData?.uiSurfaces?.includes('extension-team-configuration')) {
            if (shouldBeInstalled) {
              return `Extension has been installed successfully. Configure it here: https://app.netlify.com/team/${teamId}/extension/${extensionSlug}`
            }
          }else if (siteId && extensionData.uiSurfaces?.includes('extension-top-level-site-configuration')) {
            const site = await getSite({ siteId, incomingRequest: request });
    
            if(shouldBeInstalled){
              return `Extension has been installed successfully. Configure it here: https://app.netlify.com/sites/${site.name}/extensions/${extensionSlug}`
            }
          }
    
        } catch (error: any) {
          const errorMessage = error.message || 'Failed to install extension';
          appendErrorToLog(errorMessage);
          return `Failed to ${shouldBeInstalled ? 'install' : 'uninstall'} the extension. Ensure the extension slug is correct but getting the list of extensions. Error: ${errorMessage}`
        }
    
        return `Extension ${shouldBeInstalled ? 'installed' : 'uninstalled'} successfully.`;
      }
    };
  • Handler (cb) for the 'initialize-database' operation dispatched by netlify-extension-services-updater; provides instructions for database setup.
    export const initializeDatabaseDomainTool: DomainTool<typeof initializeDatabaseParamsSchema> = {
      domain: 'extension',
      operation: 'initialize-database',
      inputSchema: initializeDatabaseParamsSchema,
      toolAnnotations: {
        readOnlyHint: false,
      },
      cb: async () => {
        return 'Ensure the @netlify/neon npm package is installed. After installation, restart the development server or run new build.';
      }
    }
  • Helper function that categorizes domain tools into readOnlyTools and writeTools based on readOnlyHint annotation, enabling separate registration of reader/updater services.
    export const categorizeToolsByReadWrite = (domainTools: DomainTool<any>[]) => {
      const readOnlyTools = domainTools.filter(tool => tool.toolAnnotations.readOnlyHint === true);
      const writeTools = domainTools.filter(tool => tool.toolAnnotations.readOnlyHint === false || tool.toolAnnotations.readOnlyHint === undefined);
      
      return {
        readOnlyTools,
        writeTools
      };
    };
Behavior3/5

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

Annotations declare readOnlyHint=false, which aligns with the description's 'write operations' claim, so no contradiction exists. The description adds minimal behavioral context beyond annotations by specifying this is a selector/dispatcher for two specific operations, but doesn't disclose important traits like whether operations are reversible, have side effects, require specific permissions, or have rate limits. With annotations covering only the read/write aspect, the description provides some but insufficient behavioral context.

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

Conciseness3/5

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

The description is brief (one sentence) but inefficiently structured. It front-loads the dispatcher concept but wastes space listing operation names without explaining their purposes. The sentence could be more informative by explaining why this dispatcher exists or what 'write operations' entail. While concise, it doesn't maximize information density.

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 this is a mutation tool (write operations) with no output schema and minimal annotations, the description is insufficient. It doesn't explain what the two operations do, their effects, or what they return. The agent must rely entirely on the input schema's parameter names to understand the operations. For a tool that dispatches to potentially destructive operations, more context about behavior and outcomes is needed.

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

Parameters4/5

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

The description doesn't mention parameters at all, but the input schema has only one parameter (selectSchema) with 0% description coverage. Since this is essentially a dispatcher with a single selector parameter, the lack of parameter explanation in the description is less critical. The description does clarify that users must 'select and run one of the following' operations, which implicitly explains the parameter's purpose. For a single-parameter dispatcher tool, this is reasonably adequate.

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

Purpose2/5

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

The description states 'Select and run one of the following Netlify write operations' which indicates it's a selector/dispatcher tool rather than performing a specific operation itself. However, it's vague about what 'write operations' means and doesn't clearly distinguish this tool from its siblings like 'netlify-extension-services-reader' or other updaters. The description restates the tool name's concept of 'updater' without adding specificity.

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 mentions 'write operations' but provides no guidance on when to use this tool versus its sibling tools. There's no indication of what scenarios require this dispatcher approach versus using individual operation tools directly, nor any mention of prerequisites or constraints. The agent must infer usage from the operation names alone.

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/netlify/netlify-mcp'

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