Skip to main content
Glama

image-delete

Remove specific images by ID or delete all images associated with a key on the MCP Index Notes server. Simplify image management and maintain organized data.

Instructions

Delete an image by id or all images by key.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNo
keyNo

Implementation Reference

  • Handler for 'image-delete' tool call. Parses arguments using ImageDeleteSchema, checks for image support in store, deletes image by ID using deleteImageById or all by key using deleteImagesByKey, returns JSON result.
    case 'image-delete': { const parsed = ImageDeleteSchema.parse(args ?? {}); if (!('deleteImageById' in (db as any))) { throw new Error('Image storage not supported in current store implementation'); } if (parsed.id) { const ok = (db as any).deleteImageById(parsed.id); return { content: [{ type: 'text', text: JSON.stringify({ ok }) }] }; } if (parsed.key) { const deleted = (db as any).deleteImagesByKey(parsed.key); return { content: [{ type: 'text', text: JSON.stringify({ deleted }) }] }; } return { content: [{ type: 'text', text: JSON.stringify({ error: 'Provide id or key' }) }] };
  • Zod schema ImageDeleteSchema used to validate input for image-delete tool: optional id (number) or key (string).
    export const ImageDeleteSchema = z.object({ id: z.number().int().positive().optional(), key: z.string().optional(), }); export type ImageDeleteInput = z.infer<typeof ImageDeleteSchema>;
  • src/mcp.ts:90-97 (registration)
    Tool registration in the tools array exported for MCP ListTools. Defines name, description, and basic input schema.
    name: 'image-delete', description: 'Delete an image by id or all images by key.', inputSchema: { type: 'object', properties: { id: { type: 'number' }, key: { type: 'string' } }, }, }, {
  • Database method to delete a single image by its ID. Used by image-delete handler when id is provided.
    deleteImageById(id: number): boolean { const info = this.db.prepare(`DELETE FROM images WHERE id = ?`).run(id); return info.changes > 0; }
  • Database method to delete all images associated with a specific key. Used by image-delete handler when key is provided.
    deleteImagesByKey(key: string): number { const info = this.db.prepare(`DELETE FROM images WHERE key = ?`).run(key); return info.changes; }

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/vjsr007/mcp-index-notes'

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