Skip to main content
Glama

delete_secret

Remove sensitive data from a project by deleting stored secrets to maintain security and manage access controls.

Instructions

Delete a secret from a project.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesThe project ID
keyYesSecret key to delete

Implementation Reference

  • The handleDeleteSecret function is the main handler that deletes a secret from a project. It validates the project exists via getProject(), makes an authenticated DELETE request to the API endpoint /admin/v1/projects/{project_id}/secrets/{key}, and returns a success message or error response.
    export async function handleDeleteSecret(args: {
      project_id: string;
      key: string;
    }): Promise<{ content: Array<{ type: "text"; text: string }>; isError?: boolean }> {
      const project = getProject(args.project_id);
      if (!project) return projectNotFound(args.project_id);
    
      const res = await apiRequest(
        `/admin/v1/projects/${args.project_id}/secrets/${encodeURIComponent(args.key)}`,
        {
          method: "DELETE",
          headers: {
            Authorization: `Bearer ${project.service_key}`,
          },
        },
      );
    
      if (!res.ok) return formatApiError(res, "deleting secret");
    
      return {
        content: [
          {
            type: "text",
            text: `Secret \`${args.key}\` deleted from project \`${args.project_id}\`.`,
          },
        ],
      };
    }
  • The deleteSecretSchema defines the input validation schema using Zod, requiring project_id (string) and key (string) parameters for identifying which secret to delete.
    export const deleteSecretSchema = {
      project_id: z.string().describe("The project ID"),
      key: z.string().describe("Secret key to delete"),
    };
  • src/index.ts:190-195 (registration)
    Registers the 'delete_secret' tool with the MCP server, providing the tool name, description ('Delete a secret from a project.'), schema, and handler function.
    server.tool(
      "delete_secret",
      "Delete a secret from a project.",
      deleteSecretSchema,
      async (args) => handleDeleteSecret(args),
    );

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/kychee-com/run402'

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