Skip to main content
Glama

jp_lit_delete_cache

Delete cached data by cache key or tool to free local storage and retrieve up-to-date Japanese literature search results.

Instructions

ローカル保存されたキャッシュを cache_key 単位または tool 単位で削除する

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
toolYes
cache_keyYes
clear_allYes
deleted_countYes
deletedYes
messageYes

Implementation Reference

  • Main handler function that deletes cache entries by cache_key (single) or clear_all (bulk per tool) using the FileCache interface.
    export function createJpLitDeleteCacheTool(cache: FileCache) {
      return async (input: unknown) => {
        const parsed = deleteCacheInputSchema.parse(input);
    
        let deletedCount = 0;
        let deleted = false;
        if (parsed.clear_all) {
          deletedCount = await cache.clear(parsed.tool);
          deleted = deletedCount > 0;
        } else if (parsed.cache_key) {
          deleted = await cache.delete(parsed.tool, parsed.cache_key);
          deletedCount = deleted ? 1 : 0;
        }
    
        const structuredContent: DeleteCacheOutput = deleteCacheOutputSchema.parse({
          tool: parsed.tool,
          cache_key: parsed.cache_key ?? null,
          clear_all: parsed.clear_all,
          deleted_count: deletedCount,
          deleted,
          message: parsed.clear_all
            ? `${parsed.tool} のキャッシュを ${deletedCount} 件削除しました`
            : deleted
              ? `cache_key=${parsed.cache_key} を削除しました`
              : `cache_key=${parsed.cache_key} は見つかりませんでした`
        });
    
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify(structuredContent, null, 2)
            }
          ],
          structuredContent
        };
      };
    }
  • Input schema: requires either cache_key or clear_all=true; tool defaults to 'jp_lit_search'.
    export const deleteCacheInputSchema = z
      .object({
        tool: z.string().trim().min(1).default("jp_lit_search"),
        cache_key: z.string().trim().min(1).optional(),
        clear_all: z.boolean().default(false)
      })
      .superRefine((data, ctx) => {
        if (!data.clear_all && !data.cache_key) {
          ctx.addIssue({
            code: z.ZodIssueCode.custom,
            message: "cache_key を指定するか clear_all=true を指定してください",
            path: ["cache_key"]
          });
        }
      });
  • Output schema containing tool name, cache_key, clear_all flag, deleted_count, deleted boolean, and a human-readable message.
    export const deleteCacheOutputSchema = z.object({
      tool: z.string(),
      cache_key: z.string().nullable(),
      clear_all: z.boolean(),
      deleted_count: z.number().int().nonnegative(),
      deleted: z.boolean(),
      message: z.string()
    });
  • src/server.ts:477-485 (registration)
    Registration of the tool with the MCP server under the name 'jp_lit_delete_cache' with description and schemas.
    server.registerTool(
      "jp_lit_delete_cache",
      {
        description: "ローカル保存されたキャッシュを cache_key 単位または tool 単位で削除する",
        inputSchema: deleteCacheInputSchema,
        outputSchema: deleteCacheOutputSchema
      },
      deleteCacheTool
    );
  • src/server.ts:80-80 (registration)
    Import of the handler factory, and line 315 instantiates it: const deleteCacheTool = createJpLitDeleteCacheTool(cache);
    import { createJpLitDeleteCacheTool } from "./tools/jpLitDeleteCache.js";
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states that cache is deleted but does not disclose destructive effects, authorization needs, or what happens to related data. The omission of behavior beyond basic deletion is a significant gap.

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

Conciseness3/5

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

The description is a single sentence, which is concise, but it lacks structural elements such as parameter details or behavioral notes. It is appropriately front-loaded but incomplete.

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

Completeness1/5

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

Given the discrepancy between description and schema, and the lack of output schema details or behavioral context, the description is insufficient for an agent to understand how to use the tool. It does not compensate for the missing meaning.

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

Parameters1/5

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

The input schema has zero properties, yet the description mentions deletion by 'cache_key' or 'tool', implying parameters that are not defined. This contradiction severely undermines the agent's ability to invoke the tool correctly.

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

Purpose3/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 resource 'locally saved cache', and specifies granularity by cache_key or tool. However, it does not distinguish this tool from the sibling 'jp_lit_prune_cache', limiting its clarity for selection.

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 jp_lit_prune_cache or jp_lit_list_cache. The description lacks context for optimal usage.

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/itarunnn/jp-lit-mcp'

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