Skip to main content
Glama

twining_summarize

Generate project summaries with decision counts, open needs, warnings, and recent activity narratives to track development progress.

Instructions

Get a high-level summary of project or scope state. Returns counts of active decisions, open needs, warnings, and a recent activity narrative.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scopeNoOptional scope filter (default: "project")

Implementation Reference

  • The summarize method in ContextAssembler implements the core logic for the twining_summarize tool, aggregating project/scope state (decisions, blackboard entries, activity).
    async summarize(scope?: string): Promise<SummarizeResult> {
      const targetScope = scope ?? "project";
    
      // Get decisions
      const index = await this.decisionStore.getIndex();
      const scopeIndex = targetScope === "project"
        ? index
        : index.filter(
            (e) =>
              e.scope.startsWith(targetScope) ||
              targetScope.startsWith(e.scope),
          );
    
      const activeDecisions = scopeIndex.filter(
        (e) => e.status === "active",
      ).length;
      const provisionalDecisions = scopeIndex.filter(
        (e) => e.status === "provisional",
      ).length;
    
      // Get blackboard entries
      const readOpts = targetScope === "project" ? undefined : { scope: targetScope };
      const { entries } = await this.blackboardStore.read(readOpts);
    
      const openNeeds = entries.filter((e) => e.entry_type === "need").length;
      const activeWarnings = entries.filter(
        (e) => e.entry_type === "warning",
      ).length;
      const unansweredQuestions = entries.filter(
        (e) => e.entry_type === "question",
      ).length;
    
      // Recent activity (last 24 hours)
      const twentyFourHoursAgo = new Date(
        Date.now() - 24 * 60 * 60 * 1000,
      ).toISOString();
      const recentEntries = entries.filter(
        (e) => e.timestamp >= twentyFourHoursAgo,
      );
      const recentDecisionCount = scopeIndex.filter(
        (e) => e.timestamp >= twentyFourHoursAgo,
      ).length;
      const recentFindingCount = recentEntries.filter(
        (e) => e.entry_type === "finding",
      ).length;
      const recentWarningCount = recentEntries.filter(
        (e) => e.entry_type === "warning",
      ).length;
    
      let recentActivitySummary =
        `In the last 24 hours: ${recentDecisionCount} decision${recentDecisionCount !== 1 ? "s" : ""} made, ` +
        `${recentFindingCount} finding${recentFindingCount !== 1 ? "s" : ""} posted, ` +
        `${recentWarningCount} warning${recentWarningCount !== 1 ? "s" : ""} raised.`;
    
      // Integrate planning state from .planning/ directory
      const planningState = this.planningBridge?.readPlanningState() ?? null;
    
      if (planningState) {
        recentActivitySummary += ` Current phase: ${planningState.current_phase}. Progress: ${planningState.progress}.`;
      }
    
      const result: SummarizeResult = {
        scope: targetScope,
        active_decisions: activeDecisions,
        provisional_decisions: provisionalDecisions,
        open_needs: openNeeds,
        active_warnings: activeWarnings,
        unanswered_questions: unansweredQuestions,
        recent_activity_summary: recentActivitySummary,
      };
    
      if (planningState) {
        result.planning_state = planningState;
      }
    
      return result;
    }
  • The twining_summarize tool is registered here, providing the tool description, input schema, and handler invocation calling ContextAssembler.summarize.
    server.registerTool(
      "twining_summarize",
      {
        description:
          "Get a high-level summary of project or scope state. Returns counts of active decisions, open needs, warnings, and a recent activity narrative.",
        inputSchema: {
          scope: z
            .string()
            .optional()
            .describe('Optional scope filter (default: "project")'),
        },
      },
      async (args) => {
        try {
          const result = await contextAssembler.summarize(args.scope);
          return toolResult(result);
        } catch (e) {
          if (e instanceof TwiningError) {
            return toolError(e.message, e.code);
          }
          return toolError(
            e instanceof Error ? e.message : "Unknown error",
            "INTERNAL_ERROR",
          );
        }
      },
    );
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool returns summary data but does not disclose important behavioral traits such as whether it requires authentication, has rate limits, is read-only or mutative, or how it handles errors. The description is minimal and lacks context beyond the basic output.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded, consisting of two sentences that directly state the tool's purpose and output. There is no wasted language, and it efficiently communicates the core functionality. However, it could be slightly more structured by explicitly separating purpose from output details.

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 (simple read operation with one optional parameter) and lack of annotations and output schema, the description is moderately complete. It explains what the tool does and what it returns, but it lacks details on behavioral aspects and usage context. Without an output schema, it should ideally describe return values more thoroughly, but it does provide a high-level overview of the output content.

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

Parameters3/5

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

The input schema has 100% description coverage, with one optional parameter 'scope' documented as 'Optional scope filter (default: "project").' The description does not add any meaning beyond this, as it does not mention parameters at all. With high schema coverage, the baseline score of 3 is appropriate, as the schema adequately covers parameter semantics without additional description.

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 clearly states the tool's purpose: 'Get a high-level summary of project or scope state.' It specifies the verb 'Get' and resource 'summary,' and details what the summary includes (counts of active decisions, open needs, warnings, and recent activity narrative). However, it does not explicitly differentiate this from sibling tools like 'twining_status' or 'twining_what_changed,' which might offer similar or overlapping functionality.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It mentions the tool returns specific summary data but does not indicate scenarios where this summary is preferred over other tools like 'twining_status' or 'twining_what_changed,' nor does it specify any prerequisites or exclusions for its use.

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/daveangulo/twining-mcp'

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