Skip to main content
Glama

jp_lit_export_view

Export cache-based view results (list, cross-search, re-extraction) directly to an exports folder. Supports full export of refined results with duplicate check notes.

Instructions

キャッシュ系ビュー(一覧・横断検索・再抽出)の結果を exports/ に直接書き出す。refined_results は全件 export と重複確認ノートに対応

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
viewYes
formatYes
pathYes
exported_atYes
item_countYes

Implementation Reference

  • The main handler function 'createJpLitExportViewTool' that executes the export view logic. It parses input (cache_list, cache_query, or refined_results), calls the appropriate view tool, formats output as JSON or Markdown, writes to a file under exports/, and returns structured content.
    export function createJpLitExportViewTool(
      tools: ViewTools,
      baseDir = process.cwd()
    ) {
      return async (input: unknown) => {
        const parsed = exportViewInputSchema.parse(input);
        let output: ViewOutput;
        if (parsed.view === "cache_list") {
          const result = await tools.listCache(parsed.params);
          output = result.structuredContent;
        } else if (parsed.view === "cache_query") {
          const result = await tools.searchCacheIndex(parsed.params);
          output = result.structuredContent;
        } else {
          output = await resolveRefinedResultsOutput(tools, parsed);
        }
    
        const target =
          parsed.output_path ??
          defaultExportPath(baseDir, parsed.view, parsed.format);
        const exportedAt = new Date().toISOString();
        const itemCount = resolveItemCount(parsed.view, output);
    
        await mkdir(path.dirname(target), { recursive: true });
        if (parsed.format === "json") {
          await writeFile(target, JSON.stringify(output, null, 2), "utf8");
        } else {
          await writeFile(target, renderMarkdown(parsed.view, output, exportedAt), "utf8");
        }
    
        const structuredContent: ExportViewOutput = exportViewOutputSchema.parse({
          view: parsed.view,
          format: parsed.format,
          path: target,
          exported_at: exportedAt,
          item_count: itemCount
        });
    
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify(structuredContent, null, 2)
            }
          ],
          structuredContent
        };
      };
    }
  • Helper functions: defaultExportPath generates a timestamped export file path under exports/; resolveItemCount extracts the item count from different view output types.
    function defaultExportPath(
      baseDir: string,
      view: "cache_list" | "cache_query" | "refined_results",
      format: "markdown" | "json"
    ) {
      const extension = format === "markdown" ? "md" : "json";
      const stamp = new Date().toISOString().replace(/[:.]/g, "-");
      return path.join(getExportsRoot(baseDir), `${view}.${stamp}.${extension}`);
    }
    
    function resolveItemCount(view: "cache_list" | "cache_query" | "refined_results", output: ViewOutput) {
      if (view === "refined_results") {
        const payload = output as RefineResultsOutput;
        return payload.total_after;
      }
      const payload = output as ListCacheOutput | SearchCacheIndexOutput;
      return payload.total;
    }
Behavior3/5

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

The description adds behavioral context (writes directly to exports/, special handling for refined_results) but lacks details on side effects, overwrite behavior, or authorization needs. Without annotations, the description partially fulfills transparency but leaves gaps.

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 concise sentences in Japanese that efficiently convey the tool's purpose and a special case. No wasted words.

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 zero-parameter export tool with an output schema, the description covers the essential action and a specific feature. It is complete enough for this simple tool.

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?

The input schema has no parameters (100% coverage). The description does not need to add parameter info, and it does not introduce confusion. Baseline score of 4 for zero-parameter tools.

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 it exports cache-type view results (list, cross-search, re-extraction) to the exports/ directory, with specific mention of refined_results support. This distinguishes it from sibling tools like jp_lit_export_session.

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 usage for exporting cache views but provides no explicit guidance on when not to use it or differentiate from similar sibling export tools. Usage is implied but not fully contextualized.

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