Skip to main content
Glama

twining_reconsider

Flag decisions for reconsideration by setting them to provisional status, posting warnings with impact analysis to coordinate agent actions.

Instructions

Flag a decision for reconsideration. Sets active decisions to provisional status and posts a warning to the blackboard with downstream impact analysis.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
decision_idYesID of the decision to reconsider
new_contextYesNew context or reason for reconsideration
agent_idNoID of the agent requesting reconsideration

Implementation Reference

  • The business logic for 'twining_reconsider' which marks a decision as provisional and warns about downstream impacts.
    async reconsider(
      decisionId: string,
      newContext: string,
      agentId?: string,
    ): Promise<{ flagged: boolean; decision_summary: string }> {
      const decision = await this.decisionStore.get(decisionId);
      if (!decision) {
        throw new TwiningError(
          `Decision not found: ${decisionId}`,
          "NOT_FOUND",
        );
      }
    
      let flagged = false;
      if (decision.status === "active") {
        await this.decisionStore.updateStatus(decisionId, "provisional");
        flagged = true;
      }
    
      // Check for downstream dependents
      const index = await this.decisionStore.getIndex();
      const downstreamIds: string[] = [];
      for (const entry of index) {
        const d = await this.decisionStore.get(entry.id);
        if (d && d.depends_on.includes(decisionId)) {
          downstreamIds.push(d.id);
        }
      }
    
      let detail = newContext;
      if (downstreamIds.length > 0) {
        detail += `\nNote: ${downstreamIds.length} downstream decisions may be affected: ${downstreamIds.join(", ")}`;
      }
    
      // Post warning to blackboard
      await this.blackboardEngine.post({
        entry_type: "warning",
        summary: `Reconsideration flagged: ${decision.summary}`.slice(0, 200),
        detail,
        tags: [decision.domain],
        scope: decision.scope,
        agent_id: agentId ?? "main",
      });
    
      // Auto-populate graph with challenged relation
      if (this.graphPopulator) {
        await this.graphPopulator.onChallenge(agentId ?? "main", decisionId, "reconsider");
      }
    
      return { flagged, decision_summary: decision.summary };
    }
  • Registration of the 'twining_reconsider' MCP tool.
    // twining_reconsider — Flag a decision for reconsideration
    server.registerTool(
      "twining_reconsider",
      {
        description:
          "Flag a decision for reconsideration. Sets active decisions to provisional status and posts a warning to the blackboard with downstream impact analysis.",
        inputSchema: {
          decision_id: z.string().describe("ID of the decision to reconsider"),
          new_context: z
            .string()
            .describe("New context or reason for reconsideration"),
          agent_id: z
            .string()
            .optional()
            .describe("ID of the agent requesting reconsideration"),
        },
      },
      async (args) => {
        try {
          const result = await engine.reconsider(
            args.decision_id,
            args.new_context,
            args.agent_id,
          );
          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",
          );
        }
      },
    );

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