Skip to main content
Glama

localnest_capture_outcome

Capture task outcomes into a local memory pipeline by recording details like status, summary, and metadata for project tracking.

Instructions

Capture a meaningful task outcome into the memory event pipeline with a simpler payload.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskNo
titleNo
summaryNo
detailsNo
contentNo
event_typeNotask
statusNocompleted
kindNoknowledge
importanceNo
confidenceNo
files_changedNo
has_testsNo
tagsNo
linksNo
root_pathNo
project_pathNo
branch_nameNo
topicNo
featureNo
source_refNo
response_formatNojson

Implementation Reference

  • The `captureOutcome` method in `MemoryWorkflowService` handles the logic for capturing task outcomes, normalizing the input, and calling `this.memory.captureEvent`.
    async captureOutcome(input = {}) {
      const memoryStatus = await this.memory.getStatus();
      const runtime = this.getRuntimeSummary ? await this.getRuntimeSummary() : null;
      const memorySummary = compactMemoryStatus(memoryStatus);
    
      if (!memorySummary.enabled) {
        return {
          captured: false,
          skipped_reason: 'memory_disabled',
          runtime,
          memory: memorySummary
        };
      }
    
      if (!memorySummary.backend_available) {
        return {
          captured: false,
          skipped_reason: 'backend_unavailable',
          runtime,
          memory: memorySummary
        };
      }
    
      const eventType = cleanText(input.event_type || input.eventType || input.outcome_type || 'task', 60) || 'task';
      const task = cleanText(input.task || input.title, 400);
      const summary = cleanText(input.summary, 4000);
      const details = cleanText(input.details || input.content, 20000);
      const fallbackContent = cleanText([summary, details, task].filter(Boolean).join('. '), 20000);
    
      if (!task && !summary && !details) {
        throw new Error('task, summary, or details is required');
      }
    
      const captureInput = {
        event_type: eventType,
        status: defaultEventStatus(eventType, input.status),
        title: task || summary || details,
        summary,
        content: details || fallbackContent,
        kind: input.kind,
        importance: input.importance,
        confidence: input.confidence,
        files_changed: input.files_changed ?? input.filesChanged ?? 0,
        has_tests: input.has_tests ?? input.hasTests ?? false,
        tags: uniqueStrings([
          ...(input.tags || []),
          input.topic,
          input.feature
        ]),
        links: Array.isArray(input.links) ? input.links.slice(0, 50) : [],
        scope: {
          root_path: input.root_path || input.rootPath,
          project_path: input.project_path || input.projectPath,
          branch_name: input.branch_name || input.branchName,
          topic: input.topic,
          feature: input.feature
        },
        source_ref: cleanText(input.source_ref || input.sourceRef, 1000)
      };
    
      const result = await this.memory.captureEvent(captureInput);
      return {
        captured: true,
        runtime,
        memory: memorySummary,
        event: captureInput,
        result
      };
    }
  • The `localnest_capture_outcome` tool is registered here, delegating the call to `memoryWorkflow.captureOutcome`.
    registerJsonTool(
      ['localnest_capture_outcome'],
      {
        title: 'Capture Outcome',
        description: 'Capture a meaningful task outcome into the memory event pipeline with a simpler payload.',
        inputSchema: {
          task: z.string().optional(),
          title: z.string().optional(),
          summary: z.string().optional(),
          details: z.string().optional(),
          content: z.string().optional(),
          event_type: MEMORY_EVENT_TYPE_SCHEMA,
          status: MEMORY_EVENT_STATUS_SCHEMA.optional(),
          kind: MEMORY_KIND_SCHEMA.optional(),
          importance: z.number().int().min(0).max(100).optional(),
          confidence: z.number().min(0).max(1).optional(),
          files_changed: z.number().int().min(0).max(10000).default(0),
          has_tests: z.boolean().default(false),
          tags: z.array(z.string()).max(50).default([]),
          links: z.array(MEMORY_LINK_SCHEMA).max(50).default([]),
          root_path: z.string().optional(),
          project_path: z.string().optional(),
          branch_name: z.string().optional(),
          topic: z.string().optional(),
          feature: z.string().optional(),
          source_ref: z.string().max(1000).default('')
        },
        annotations: {
          readOnlyHint: false,
          destructiveHint: false,
          idempotentHint: false,
          openWorldHint: false
        }
      },
      async (args) => normalizeCaptureOutcomeResult(await memoryWorkflow.captureOutcome(args))
    );

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/wmt-mobile/localnest'

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