Skip to main content
Glama
TAgents

Planning System MCP Server

by TAgents

task_context

Retrieve progressive context for a task with depths from task-only to extended plan and transitive dependencies. For RPI implement tasks, automatically includes research and plan outputs.

Instructions

Get progressive context for a task. Depth: 1 (task only), 2 (+ neighborhood), 3 (+ knowledge), 4 (+ extended plan/goals/transitive deps). For RPI implement tasks, automatically includes research+plan outputs from the chain.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYes
depthNo
token_budgetNo

Implementation Reference

  • Handler function for task_context: takes task_id, depth (1-4), token_budget; calls /context/progressive API and returns formatted response with as_of timestamp.
    async function taskContextHandler(args, apiClient) {
      const { task_id, depth = 2, token_budget = 0 } = args;
      const params = new URLSearchParams({
        node_id: task_id,
        depth: String(depth),
        token_budget: String(token_budget),
        log_limit: '10',
        include_research: 'true',
      });
      try {
        const response = await apiClient.axiosInstance.get(`/context/progressive?${params}`);
        return formatResponse({ as_of: asOf(), ...response.data });
      } catch (err) {
        return errorResponse('upstream_unavailable', `Failed to load task context: ${err.response?.data?.error || err.message}`);
      }
    }
  • Schema definition for task_context tool: name, description, inputSchema with task_id (required), depth (enum 1-4, default 2), token_budget (default 0).
    const taskContextDefinition = {
      name: 'task_context',
      description:
        "Get progressive context for a task. Depth: 1 (task only), 2 (+ neighborhood), " +
        "3 (+ knowledge), 4 (+ extended plan/goals/transitive deps). For RPI implement " +
        "tasks, automatically includes research+plan outputs from the chain.",
      inputSchema: {
        type: 'object',
        properties: {
          task_id: { type: 'string' },
          depth: { type: 'integer', enum: [1, 2, 3, 4], default: 2 },
          token_budget: { type: 'integer', default: 0 },
        },
        required: ['task_id'],
      },
    };
  • Exports taskContextDefinition in definitions array and taskContextHandler mapped to 'task_context' key in handlers object.
    module.exports = {
      definitions: [
        briefingDefinition,
        taskContextDefinition,
        goalStateDefinition,
        recallKnowledgeDefinition,
        listPlansDefinition,
        searchDefinition,
        planAnalysisDefinition,
      ],
      handlers: {
        briefing: briefingHandler,
        task_context: taskContextHandler,
        goal_state: goalStateHandler,
        recall_knowledge: recallKnowledgeHandler,
        list_plans: listPlansHandler,
        search: searchHandler,
        plan_analysis: planAnalysisHandler,
      },
  • Aggregates all BDI tool definitions (including task_context) from beliefs, desires, intentions, utility modules into bdiToolDefinitions.
    module.exports = {
      bdiToolDefinitions: definitions,
      bdiToolHandler,
      bdiToolNames: names,
    };
  • src/tools.js:26-28 (registration)
    MCP server registration: wires bdiToolDefinitions into ListToolsRequestSchema handler so task_context is exposed as an MCP tool.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools: bdiToolDefinitions };
    });
Behavior4/5

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

With no annotations, the description discloses the progressive nature of context, depth effects, and the automatic inclusion for RPI tasks. It doesn't mention side effects (likely none) but hints at a token budget parameter, which adds transparency.

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 two sentences, front-loading the purpose and depth summary, then adding a key specialization. Every sentence provides necessary information without redundancy.

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?

The description covers depth levels and the RPI special case, but lacks explanation of token_budget semantics and return format. Given no output schema, the agent lacks guidance on expected output structure, making it incomplete.

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 coverage is 0%, so description must compensate. While it explains depth values, it does not describe 'task_id' or 'token_budget' beyond their schema types. Token_budget's purpose (e.g., limit, hint) is ambiguous, leaving semantic gaps.

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 'Get progressive context for a task' – a specific verb and resource. The depth levels and automatic inclusion for RPI tasks differentiate it from sibling tools, which are mostly CRUD or planning operations.

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?

The description explains depth levels and a special case for RPI tasks, providing context on when to use different depth values. However, it does not explicitly state when not to use the tool or mention alternatives, though sibling tools do not offer similar functionality.

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/TAgents/agent-planner-mcp'

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