Skip to main content
Glama

jp_lit_update_session_trace

Append research goal, scope, source plans, open questions, and next actions to the current session trace. Keep a log of investigation progress and decisions for Japanese literature research.

Instructions

現在の調査セッション全体に、調査目的・確認範囲・source 選択理由・未確認事項・次アクションを追記する。検索結果や選択候補そのものではなく、調査経過と判断の台帳を残すための tool

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
research_goalNo
scope_noteNo
source_plansNo
open_questionsNo
next_actionsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYes
updated_atYes
source_plan_countYes
open_question_countYes
next_action_countYes

Implementation Reference

  • Main handler function for jp_lit_update_session_trace. Parses input via Zod schema, calls sessionStore.updateTrace(), and returns structured content with session_id, updated_at, and counts of source_plans, open_questions, and next_actions.
    export function createJpLitUpdateSessionTraceTool(sessionStore: SessionStore) {
      return async (input: unknown) => {
        const parsed = updateSessionTraceInputSchema.parse(input);
        const session = await sessionStore.updateTrace(parsed);
    
        const structuredContent: UpdateSessionTraceOutput =
          updateSessionTraceOutputSchema.parse({
            session_id: session.session_id,
            updated_at: session.updated_at,
            source_plan_count: session.trace?.source_plans.length ?? 0,
            open_question_count: session.trace?.open_questions.length ?? 0,
            next_action_count: session.trace?.next_actions.length ?? 0
          });
    
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify(structuredContent, null, 2)
            }
          ],
          structuredContent
        };
      };
    }
  • sessionStore.updateTrace() implementation. Reads the current session, merges trace fields (research_goal, scope_note overwrite; source_plans, open_questions, next_actions append with timestamps), and persists.
    async updateTrace(input) {
      const session = await this.readCurrent();
      const timestamp = nowIso();
      const currentTrace = normalizeSessionTrace(session.trace);
      const nextTrace: SessionTrace = {
        ...currentTrace,
        ...(input.research_goal !== undefined
          ? { research_goal: input.research_goal }
          : {}),
        ...(input.scope_note !== undefined ? { scope_note: input.scope_note } : {}),
        source_plans: [
          ...currentTrace.source_plans,
          ...(input.source_plans ?? []).map((entry) => ({
            ...entry,
            created_at: timestamp
          }))
        ],
        open_questions: [
          ...currentTrace.open_questions,
          ...(input.open_questions ?? []).map((entry) => ({
            ...entry,
            created_at: timestamp
          }))
        ],
        next_actions: [
          ...currentTrace.next_actions,
          ...(input.next_actions ?? []).map((entry) => ({
            ...entry,
            created_at: timestamp
          }))
        ]
      };
    
      const next: SessionDocument = {
        ...session,
        updated_at: timestamp,
        ...(hasSessionTraceContent(nextTrace) ? { trace: nextTrace } : {})
      };
    
      await persist(next);
      return next;
    },
Behavior3/5

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

No annotations provided, so description carries full burden. It states it 'appends' to the current session, implying a write operation with no overwrite. It mentions 'keeping a ledger' suggesting persistence. However, it does not disclose potential side effects (e.g., append-only vs. replacement), authorization needs, or error conditions. Adequate for a straightforward logging tool but could be more explicit.

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?

Description is a single, well-structured sentence that conveys purpose, scope, and negative use case. No extraneous information. Efficiently front-loads the key action and purpose.

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

Completeness3/5

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

Given the tool's complexity (5 parameters, nested objects) and 0% schema description coverage, the description is somewhat brief. It provides enough for high-level understanding but lacks detail on required parameters (none required) and structure. The presence of an output schema partially compensates, but more depth would improve completeness.

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

Parameters2/5

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

Schema description coverage is 0%, and the description provides only high-level mapping (research_goal, scope_note, etc.) without detailing the structure of nested parameters like source_plans or next_actions. The parameter names are somewhat self-explanatory, but the complex nested objects lack semantic guidance. This forces agents to rely heavily on schema structure.

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?

Description clearly states the tool appends research logs (purpose, scope, source reasons, open questions, next actions) to the current session. It explicitly distinguishes itself from search/selection tools by stating it is for logging progress and decisions, not for search results. This differentiates it from siblings like jp_lit_annotate_session.

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

Usage Guidelines4/5

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

Description indicates when to use (logging research progress) and what not to use it for (not for search results). However, it does not explicitly mention alternatives or when to avoid using this tool. The negative direction helps, but lacks clear guidance on prerequisites or comparison with related tools.

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