Skip to main content
Glama

plsreadme_delete

Destructive

Permanently delete a plsreadme document by providing its document ID or original file path. The admin token is automatically retrieved from your local .plsreadme record.

Instructions

Delete a plsreadme document permanently.

Requires either the document ID or the original file path. Looks up the admin token from the local .plsreadme record file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoDocument ID to delete.
file_pathNoOriginal file path (looks up the linked doc).

Implementation Reference

  • The async handler function that executes the plsreadme_delete tool logic. It looks up a DocRecord by id or file_path, calls apiDelete to delete remotely, and removeRecord to delete locally.
      async ({ id, file_path }) => {
        let record: DocRecord | undefined;
        if (id) record = getRecordById(id);
        else if (file_path) record = getRecordBySource(file_path) || getRecordBySource(resolve(process.cwd(), file_path));
    
        if (!record) return formatError('Document not found in .plsreadme records. Provide the correct ID or file path.');
    
        try {
          await apiDelete(record.id, record.admin_token);
          removeRecord(record.id);
          return {
            content: [{
              type: 'text' as const,
              text: `🗑️ Deleted: ${record.title || record.id}\n\nThe link ${record.url} is no longer accessible.`,
            }],
          };
        } catch (err) {
          return formatError((err as Error).message);
        }
      }
    );
  • Input schema for plsreadme_delete: two optional fields (id and file_path) defined using Zod.
    {
      id: z.string().optional().describe('Document ID to delete.'),
      file_path: z.string().optional().describe('Original file path (looks up the linked doc).'),
    },
  • Registration of the 'plsreadme_delete' tool on the McpServer instance via server.tool().
    // Tool: Delete a doc
    server.tool(
      'plsreadme_delete',
      `Delete a plsreadme document permanently.
    
    Requires either the document ID or the original file path. Looks up the admin token from the local .plsreadme record file.`,
      {
        id: z.string().optional().describe('Document ID to delete.'),
        file_path: z.string().optional().describe('Original file path (looks up the linked doc).'),
      },
      {
        title: 'Delete Document',
        readOnlyHint: false,
        destructiveHint: true,
        idempotentHint: false,
        openWorldHint: true,
      },
      async ({ id, file_path }) => {
        let record: DocRecord | undefined;
        if (id) record = getRecordById(id);
        else if (file_path) record = getRecordBySource(file_path) || getRecordBySource(resolve(process.cwd(), file_path));
    
        if (!record) return formatError('Document not found in .plsreadme records. Provide the correct ID or file path.');
    
        try {
          await apiDelete(record.id, record.admin_token);
          removeRecord(record.id);
          return {
            content: [{
              type: 'text' as const,
              text: `🗑️ Deleted: ${record.title || record.id}\n\nThe link ${record.url} is no longer accessible.`,
            }],
          };
        } catch (err) {
          return formatError((err as Error).message);
        }
      }
    );
  • apiDelete helper: sends a DELETE request to the PLSREADME API with the document ID and admin token.
    async function apiDelete(id: string, token: string): Promise<void> {
      const response = await fetch(`${PLSREADME_VIEW}/${id}`, {
        method: 'DELETE',
        headers: { Authorization: `Bearer ${token}` },
      });
    
      if (!response.ok) {
        const body = await response.text().catch(() => response.statusText);
        throw new Error(`Delete failed (HTTP ${response.status}): ${body}`);
      }
    }
  • removeRecord helper: removes a DocRecord from the local .plsreadme file by filtering out the given ID.
    function removeRecord(id: string): void {
      const filePath = findRecordFile();
      const records = loadRecords(filePath).filter((r) => r.id !== id);
      writeFileSync(filePath, JSON.stringify(records, null, 2) + '\n');
    }
Behavior4/5

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

Annotations mark destructiveHint=true. The description adds that deletion is 'permanently' and reveals that the tool 'Looks up the admin token from the local .plsreadme record file,' which is a behavioral dependency beyond the annotations.

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?

Two succinct sentences: first states the primary action, second provides key constraints. No unnecessary words or repetition. Every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple delete tool with no output schema, the description covers the core action, permanence, and a prerequisite. The token lookup detail is helpful. It could mention error handling or confirmation, but overall is adequate for an agent.

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

Parameters4/5

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

Schema coverage is 100% with both parameters having descriptions. The description adds the critical constraint that 'Requires either the document ID or the original file path,' clarifying that they are alternatives, which the schema's optionality does not convey.

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

Purpose5/5

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

The description clearly states the action: 'Delete a plsreadme document permanently.' The verb 'Delete' and the resource 'plsreadme document' are specific. The description distinguishes from siblings (list, share, update) as there is no other delete tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a usage prerequisite: requires either document ID or file path. However, it does not specify when not to use this tool or offer alternatives to alternatives to deletion. The guidance is minimal but present.

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/FacundoLucci/plsreadme'

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