Skip to main content
Glama

Task Context

localnest_task_context
Read-only

Bundle runtime status, memory state, and relevant recall for non-trivial tasks in one call to provide AI agents with comprehensive project context.

Instructions

Bundle runtime status, memory state, and relevant recall for a non-trivial task in one call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNo
taskNo
root_pathNo
project_pathNo
branch_nameNo
topicNo
featureNo
kindNoknowledge
limitNo
response_formatNojson

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes
metaNo

Implementation Reference

  • The 'getTaskContext' method in 'MemoryWorkflowService' is the handler that executes the 'localnest_task_context' tool logic.
    async getTaskContext(input = {}) {
      const query = deriveQuery(input);
      const memoryStatus = await this.memory.getStatus();
      const runtime = this.getRuntimeSummary ? await this.getRuntimeSummary() : null;
      const memorySummary = compactMemoryStatus(memoryStatus);
      const canRecall = memorySummary.enabled && memorySummary.backend_available;
    
      let recall = {
        attempted: false,
        skipped_reason: ''
      };
    
      if (!query) {
        recall.skipped_reason = 'empty_query';
      } else if (!memorySummary.enabled) {
        recall.skipped_reason = 'memory_disabled';
      } else if (!memorySummary.backend_available) {
        recall.skipped_reason = 'backend_unavailable';
      } else {
        const recalled = await this.memory.recall({
          query,
          rootPath: input.root_path || input.rootPath,
          projectPath: input.project_path || input.projectPath,
          branchName: input.branch_name || input.branchName,
          topic: input.topic,
          feature: input.feature,
          kind: input.kind,
          limit: input.limit
        });
        recall = {
          attempted: true,
          skipped_reason: '',
          ...recalled
        };
      }
    
      const guidance = canRecall
        ? [
          'Use recalled items as hints, then verify them with search/read tools before concluding.',
          recall.attempted && recall.count > 0
            ? 'Relevant project memory was found; check the linked files and current code before reusing the prior approach.'
            : 'No matching memory was found; continue with retrieval tools and capture the outcome if the work produces durable knowledge.'
        ]
        : [
          'Memory is disabled or unavailable on this runtime; rely on retrieval tools only.'
        ];
    
      return {
        query,
        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 || ''
        },
        runtime,
        memory: memorySummary,
        recall,
        guidance
      };
    }
  • The 'localnest_task_context' tool is registered in 'src/mcp/tools/memory-workflow.js' using 'registerJsonTool'.
    registerJsonTool(
      ['localnest_task_context'],
      {
        title: 'Task Context',
        description: 'Bundle runtime status, memory state, and relevant recall for a non-trivial task in one call.',
        inputSchema: {
          query: z.string().optional(),
          task: z.string().optional(),
          root_path: z.string().optional(),
          project_path: z.string().optional(),
          branch_name: z.string().optional(),
          topic: z.string().optional(),
          feature: z.string().optional(),
          kind: MEMORY_KIND_SCHEMA.optional(),
          limit: z.number().int().min(1).max(20).default(8)
        },
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: false,
          openWorldHint: false
        }
      },
      async (args) => normalizeTaskContextResult(await memoryWorkflow.getTaskContext(args), args)
    );
Behavior4/5

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

Annotations declare readOnlyHint=true, confirming safety. The description adds valuable behavioral context by disclosing that the tool aggregates three distinct data sources (runtime status, memory state, recall), which explains the 'bundling' behavior beyond what annotations provide. No contradiction with annotations.

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?

The description is a single, information-dense sentence with no filler. Every clause serves a purpose: defining the action ('Bundle'), content ('runtime status, memory state, and relevant recall'), context ('non-trivial task'), and efficiency benefit ('one call').

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 presence of an output schema (not shown), the description appropriately omits return value details. However, for a tool with 10 complex, completely undocumented parameters, the description provides insufficient interface documentation, leaving significant gaps in the contract despite adequately covering the high-level behavioral concept.

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?

With 0% schema description coverage across 10 parameters, the description needed to compensate significantly. It fails to mention any parameters (query, task, topic, etc.) or explain their relationships to the 'runtime status', 'memory', and 'recall' concepts. While the description vaguely alludes to filtering concepts, it does not bridge the gap for the undocumented parameters.

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

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses specific verbs ('Bundle') and resources ('runtime status', 'memory state', 'recall') and implies aggregation scope ('in one call'). However, it does not explicitly differentiate from sibling tools like localnest_memory_recall or localnest_server_status, only implying the distinction through the bundling concept.

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 phrase 'for a non-trivial task' provides implied usage context suggesting when to use this tool (complex tasks). However, it lacks explicit guidance on when NOT to use it (e.g., simple lookups) or explicit comparison to alternatives like making individual calls to memory or status 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/wmt-mobile/localnest'

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