Skip to main content
Glama
ppetru

TiddlyWiki MCP Server

by ppetru

delete_tiddler

Delete a tiddler from your TiddlyWiki by specifying its title. The tool displays the current content and requests your approval before permanently removing the tiddler.

Instructions

Delete a tiddler. Shows current content and requests approval before deleting.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesTitle of the tiddler to delete

Implementation Reference

  • Main handler function for the delete_tiddler tool. Validates input via Zod, fetches the tiddler to preview it, deletes it via the HTTP API, and returns a formatted success message with the deleted content preview.
    export async function handleDeleteTiddler(args: unknown): Promise<ToolResult> {
      const input = DeleteTiddlerInput.parse(args);
    
      // Get current tiddler to show what will be deleted
      const current = await getTiddler(input.title);
      if (!current) {
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({ error: `Tiddler not found: ${input.title}` }, null, 2),
            },
          ],
          isError: true,
        };
      }
    
      // Generate preview of what will be deleted
      const preview = formatTiddlerPreview(current);
    
      // Delete the tiddler
      await deleteTiddler(input.title);
    
      return {
        content: [
          {
            type: 'text',
            text: `## Deleted: "${input.title}"\n\n${preview}`,
          },
        ],
      };
    }
  • Zod schema for the delete_tiddler tool input. Expects a single required field: 'title' (string).
    export const DeleteTiddlerInput = z.object({
      title: z.string().describe('Title of the tiddler to delete'),
    });
  • src/index.ts:219-233 (registration)
    Registration of the 'delete_tiddler' tool in the MCP server's ListTools handler. Defines name, description, and inputSchema (title as required string).
    {
      name: 'delete_tiddler',
      description:
        'Delete a tiddler. Shows current content and requests approval before deleting.',
      inputSchema: {
        type: 'object',
        properties: {
          title: {
            type: 'string',
            description: 'Title of the tiddler to delete',
          },
        },
        required: ['title'],
      },
    },
  • src/index.ts:253-254 (registration)
    Dispatch in the CallToolRequest handler: routes the 'delete_tiddler' tool name to handleDeleteTiddler.
    case 'delete_tiddler':
      return await handleDeleteTiddler(args);
  • Low-level HTTP helper that performs a DELETE request to the TiddlyWiki API endpoint /bags/default/tiddlers/{encodedTitle}. Handles errors and logging.
    export async function deleteTiddler(title: string): Promise<void> {
      const baseUrl = await getBaseUrl();
      const encodedTitle = encodeURIComponent(title);
      const url = `${baseUrl}/bags/default/tiddlers/${encodedTitle}`;
    
      const titlePreview = title.length > 50 ? title.substring(0, 50) + '...' : title;
      logger.debug(`[TiddlyWiki HTTP] deleteTiddler: "${titlePreview}"`);
    
      const response = await fetchWithTimeout(
        url,
        {
          method: 'DELETE',
          headers: getHeaders(true),
        },
        TIMEOUT_WRITE,
        `deleteTiddler("${titlePreview}")`
      );
    
      if (!response.ok) {
        const errorBody = await response.text().catch(() => '(no body)');
        logger.error(
          `[TiddlyWiki HTTP] deleteTiddler failed: ${response.status} ${response.statusText} - ${errorBody}`
        );
        throw new Error(
          `Failed to delete tiddler "${title}": ${response.status} ${response.statusText} - ${errorBody}`
        );
      }
    
      logger.debug(`[TiddlyWiki HTTP] deleteTiddler: "${titlePreview}" OK (${response.status})`);
    }
Behavior3/5

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

With no annotations, the description carries full burden. It discloses the behavioral traits of showing content and requesting approval before deletion, but it does not mention permissions, reversibility, or what happens after approval. This is adequate but not comprehensive.

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 two sentences long, no unnecessary words, and front-loads the key action. Every sentence earns its place.

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?

Given the simplicity of the tool (one parameter, no output schema), the description covers the core behavior. It could mention side effects or how the approval request is handled, but it is mostly complete for a delete tool.

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

Parameters3/5

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

Schema coverage is 100% with one parameter 'title' described in the schema. The description adds no additional meaning beyond what the schema provides, so a baseline score of 3 is appropriate.

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 verb 'Delete' and the resource 'a tiddler', and it distinguishes from sibling tools (create, search, update) by specifying the action and the additional step of showing content and requesting approval.

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 implies a confirmation step but does not explicitly state when to use this tool versus alternatives like update_tiddler or whether there is a way to delete without approval. No guidance on prerequisites or conditions is provided.

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/ppetru/tiddlywiki-mcp'

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