Skip to main content
Glama

getSite

Retrieve detailed information about a specific Netlify site using its ID or name for site management and monitoring.

Instructions

Get details of a specific site

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteIdYesID or name of the site to retrieve

Implementation Reference

  • Handler for the 'getSite' tool: validates input, calls Netlify API to retrieve site details by siteId, handles errors like 404, and returns formatted response.
    case 'getSite': {
      const args = request.params.arguments as unknown as GetSiteArgs;
      if (!args?.siteId) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Missing required parameter: siteId'
        );
      }
      try {
        const response = await this.axiosInstance.get(`/sites/${args.siteId}`);
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                success: true,
                site: response.data,
              }, null, 2),
            },
          ],
        };
      } catch (error) {
        if (axios.isAxiosError(error)) {
          if (error.response?.status === 404) {
            throw new McpError(
              ErrorCode.InvalidParams,
              `Site not found: ${args.siteId}`
            );
          }
          throw new McpError(
            ErrorCode.InternalError,
            `Failed to get site: ${this.formatNetlifyError(error)}`
          );
        }
        throw error;
      }
    }
  • TypeScript interface defining the input arguments for the getSite tool (siteId: string).
    interface GetSiteArgs {
      siteId: string;
    }
  • src/index.ts:167-180 (registration)
    Registration of the 'getSite' tool in the ListTools response, specifying name, description, and input schema.
    {
      name: 'getSite',
      description: 'Get details of a specific site',
      inputSchema: {
        type: 'object',
        properties: {
          siteId: {
            type: 'string',
            description: 'ID or name of the site to retrieve',
          },
        },
        required: ['siteId'],
      },
    },

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

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