Skip to main content
Glama

delete_code_examples

Remove specific programming language examples from stored coding patterns to maintain clean, relevant pattern libraries for AI-assisted development.

Instructions

Delete specific code examples from patterns

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deletionsYes

Implementation Reference

  • The deleteCodeExamples method in PatternsManager class that executes the tool logic - loads the database, iterates through deletions array, finds patterns by name, and deletes specified language code examples, then saves the database.
    async deleteCodeExamples(deletions: { patternName: string; languages: string[] }[]): Promise<void> {
      const database = await this.loadDatabase();
      deletions.forEach(d => {
        const pattern = database.patterns.find(p => p.name === d.patternName);
        if (pattern) {
          d.languages.forEach(language => {
            delete pattern.code_examples[language];
          });
        }
      });
      await this.saveDatabase(database);
    }
  • The input schema definition for delete_code_examples tool - defines the expected input structure with 'deletions' array containing objects with patternName and languages fields.
      name: "delete_code_examples",
      description: "Delete specific code examples from patterns",
      inputSchema: {
        type: "object",
        properties: {
          deletions: {
            type: "array",
            items: {
              type: "object",
              properties: {
                patternName: { type: "string", description: "The name of the pattern containing the examples" },
                languages: { 
                  type: "array", 
                  items: { type: "string" },
                  description: "An array of programming languages to remove examples for"
                },
              },
              required: ["patternName", "languages"],
            },
          },
        },
        required: ["deletions"],
      },
    },
  • src/index.ts:237-260 (registration)
    Registration of the delete_code_examples tool in the ListToolsRequestSchema handler - defines tool name, description, and input schema.
      name: "delete_code_examples",
      description: "Delete specific code examples from patterns",
      inputSchema: {
        type: "object",
        properties: {
          deletions: {
            type: "array",
            items: {
              type: "object",
              properties: {
                patternName: { type: "string", description: "The name of the pattern containing the examples" },
                languages: { 
                  type: "array", 
                  items: { type: "string" },
                  description: "An array of programming languages to remove examples for"
                },
              },
              required: ["patternName", "languages"],
            },
          },
        },
        required: ["deletions"],
      },
    },
  • The case handler in CallToolRequestSchema that invokes the deleteCodeExamples method with the deletions argument and returns a success message.
    case "delete_code_examples":
      await patternsManager.deleteCodeExamples(args.deletions as { patternName: string; languages: string[] }[]);
      return { content: [{ type: "text", text: "Code examples deleted successfully" }] };
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the deletion action without disclosing behavioral traits. It doesn't mention whether deletions are permanent, require specific permissions, have rate limits, or what happens if examples don't exist, leaving significant gaps for a destructive operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words, making it appropriately sized and front-loaded. Every word contributes directly to stating the tool's purpose.

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?

For a destructive tool with no annotations, 0% schema coverage, and no output schema, the description is incomplete. It lacks details on behavior, parameters, error handling, and output, making it inadequate for safe and effective use by an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate but adds no parameter information beyond the tool name. It doesn't explain what 'deletions' array contains, how 'patternName' and 'languages' interact, or provide examples, failing to address the undocumented parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Delete') and target resource ('specific code examples from patterns'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'delete_patterns' which deletes entire patterns rather than just examples, missing full sibling differentiation.

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?

No guidance is provided on when to use this tool versus alternatives like 'delete_patterns' or 'add_code_examples'. The description lacks context about prerequisites, such as whether patterns must exist first, or exclusions like bulk operations.

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/nicholasrubright/MCPatterns'

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