Skip to main content
Glama

getSite

Retrieve detailed information about a Netlify site by providing its unique site ID using this tool, part of the Netlify MCP Server for site management.

Instructions

Get details of a specific site

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteIdYesID of the site to retrieve

Implementation Reference

  • Handler function for the 'getSite' tool. Validates input, fetches site details from Netlify API using axios, handles errors including 404, and returns formatted JSON 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, requiring a siteId string.
    interface GetSiteArgs { siteId: string; }
  • src/index.ts:167-180 (registration)
    Tool registration in the ListTools response, specifying name, description, and input schema matching the GetSiteArgs interface.
    { 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'], }, },

Other Tools

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

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