Skip to main content
Glama
netlify

Netlify MCP Server

Official
by netlify

netlify-user-services-reader

Read-only

Retrieve user account information from Netlify services using read-only operations through the Model Context Protocol.

Instructions

Select and run one of the following Netlify read operations (read-only) get-user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectSchemaYes

Implementation Reference

  • Registers the "netlify-user-services-reader" tool (read-only grouped operations for user domain). Defines selector schema, tool description, and dispatch handler that authenticates, selects sub-operation (e.g., get-user), executes subtool callback, and returns JSON result.
      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) }]
        }
      });
    }
  • Subtool handler for 'get-user' operation: calls Netlify API endpoint '/api/v1/user' using getAPIJSONResult helper and returns stringified JSON response.
    export const getUserDomainTool: DomainTool<typeof getUserParamsSchema> = {
      domain: 'user',
      operation: 'get-user',
      inputSchema: getUserParamsSchema,
      toolAnnotations: {
        readOnlyHint: true,
      },
      cb: async (_, {request}) => {
        return JSON.stringify(await getAPIJSONResult('/api/v1/user', {}, {}, request));
      }
    }
  • Registers getUserDomainTool in userDomainTools array, imported and used by main tools index to include in netlify-user-services-reader.
    export const userDomainTools = [getUserDomainTool]
  • Helper function getAPIJSONResult performs authenticated API call to Netlify, handles auth errors, parses JSON response. Used by get-user handler for /api/v1/user.
    export const getAPIJSONResult = async (urlOrPath: string, options: RequestInit = {}, apiInteractionOptions: APIInteractionOptions = {}, incomingRequest?: Request): Promise<any> => {
    
      if(!apiInteractionOptions.pagination){
        const response = await authenticatedFetch(urlOrPath, options, incomingRequest);
    
        if(response.status === 401 && incomingRequest) {
          throw new NetlifyUnauthError(`Unauthedenticated request to Netlify API. ${urlOrPath}`);
        }
    
        if (!response.ok) {
          if(apiInteractionOptions.failureCallback){
            return apiInteractionOptions.failureCallback(response);
          }
          throw new Error(`Failed to fetch API: ${response.status}`);
        }
    
        const data = await response.text();
        if (!data) {
          return '';
        }
    
        try{
          return JSON.parse(data);
        } catch (e) {
          if (apiInteractionOptions.failureCallback) {
            return apiInteractionOptions.failureCallback(response);
          }
          return data;
        }
      }
Behavior3/5

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

Annotations provide readOnlyHint=true, which the description reinforces with '(read-only)'. The description adds minimal context about being a 'read operation' but doesn't disclose any behavioral traits beyond what annotations already provide - no information about authentication requirements, rate limits, response format, or what specific user data is returned. With annotations covering the safety profile, the description adds little value.

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 but inefficiently structured - it's a single run-on sentence that awkwardly combines tool selection guidance with operation naming. While concise, it's not well-structured or front-loaded with the most critical information about what the tool actually does.

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 tool's apparent simplicity (fixed operation with no parameters) and the presence of readOnlyHint annotation, the description is incomplete. It doesn't explain what 'get-user' retrieves, what authentication is needed, or what the response contains. With no output schema and minimal description, an agent would struggle to understand when and how to use this tool effectively.

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 0%, but the tool effectively has 0 meaningful parameters for the agent - the only parameter is a nested object with a fixed 'operation' value of 'get-user'. The description doesn't explain what 'get-user' means or what user information is retrieved. Since there are no actual user-facing parameters to document, baseline 3 is appropriate, though the description could better explain the operation's purpose.

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 read operations (read-only) get-user', which is tautological - it essentially restates the tool name 'netlify-user-services-reader' as 'read operations get-user'. It doesn't specify what 'get-user' actually does (retrieve user profile, account details, etc.) or distinguish it from sibling tools like 'netlify-team-services-reader' or 'netlify-project-services-reader'.

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 minimal guidance - it mentions 'read operations' and 'read-only', but offers no explicit when-to-use criteria, no comparison to alternatives, and no context about when this tool is appropriate versus sibling tools. It doesn't explain what user information is retrieved or when to use this versus team or project services.

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