Skip to main content
Glama

deleteSite

Remove a Netlify site by specifying its unique site ID using the MCP Server, enabling efficient site management and cleanup within the Netlify environment.

Instructions

Delete a site

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteIdYesID of the site to delete

Implementation Reference

  • The main handler logic for the 'deleteSite' tool. Validates the siteId parameter, performs the API DELETE request to Netlify, handles errors like 404 for not found, and returns a success response.
    case 'deleteSite': { const args = request.params.arguments as unknown as DeleteSiteArgs; if (!args?.siteId) { throw new McpError( ErrorCode.InvalidParams, 'Missing required parameter: siteId' ); } try { await this.axiosInstance.delete(`/sites/${args.siteId}`); return { content: [ { type: 'text', text: JSON.stringify({ success: true, message: `Site ${args.siteId} deleted successfully`, }, 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 delete site: ${this.formatNetlifyError(error)}` ); } throw error; } }
  • TypeScript interface defining the input arguments for the deleteSite tool.
    interface DeleteSiteArgs { siteId: string; }
  • src/index.ts:181-194 (registration)
    Registration of the 'deleteSite' tool in the ListTools response, including name, description, and input schema.
    { name: 'deleteSite', description: 'Delete a site', inputSchema: { type: 'object', properties: { siteId: { type: 'string', description: 'ID or name of the site to delete', }, }, 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