Skip to main content
Glama
bwats
by bwats

lifeos__read_pending_queue

Retrieve proposed edges pending in the LifeOS Curator inbox. Use since and limit to paginate through the queue.

Instructions

List proposed edges waiting in the LifeOS Curator inbox. Read-only — no write opt-in required. Use since and limit to paginate.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sinceNoISO-8601 timestamp — return only edges queued after this time. Omit for all pending.
limitNoMax edges to return (default 50, max 200)

Implementation Reference

  • The main handler function that registers and implements lifeos__read_pending_queue. It queries the EdgeStore for edges in 'proposed' review state, optionally filtered by 'since' ISO timestamp and 'limit' (default 50, max 200). Returns shaped edge data including src/dst paths, type, strength, confidence, rationale, citations, etc. Handles empty queue and EdgeStore-unavailable errors gracefully.
    export function registerReadPendingQueueTool(
      server: McpServer,
      _ctx: LifeOSContext
    ): void {
      server.tool(
        TOOL_NAME,
        "List proposed edges waiting in the LifeOS Curator inbox. Read-only — no write opt-in required. Use since and limit to paginate.",
        {
          since: z
            .string()
            .optional()
            .describe(
              "ISO-8601 timestamp — return only edges queued after this time. Omit for all pending."
            ),
          limit: z
            .number()
            .int()
            .min(1)
            .max(200)
            .optional()
            .describe("Max edges to return (default 50, max 200)"),
        },
        async ({ since, limit }) => {
          try {
            const store = getEdgeStore();
            const edges = store.pendingQueue(since, limit ?? 50);
    
            if (edges.length === 0) {
              const empty = {
                count: 0,
                edges: [],
                message: "No proposed edges in the queue.",
              };
              return {
                content: [{ type: "text" as const, text: JSON.stringify(empty, null, 2) }],
              };
            }
    
            // Shape the output for the MCP client — include rationale from mcpMetadata.
            const items = edges.map((e) => ({
              edge_id: e.id,
              src: e.srcAnchor ? `${e.srcPath}#${e.srcAnchor}` : e.srcPath,
              dst: e.dstAnchor ? `${e.dstPath}#${e.dstAnchor}` : e.dstPath,
              type: e.type,
              strength: e.strength,
              confidence: e.confidence,
              queued_since: e.queuedSince,
              formed_date: e.formedDate,
              rationale: e.mcpMetadata?.rationale ?? null,
              speculative: e.mcpMetadata?.speculative ?? false,
              citations: e.citations.map((c) => ({
                path: c.nodePath,
                quote: c.quote,
              })),
            }));
    
            const result = {
              count: items.length,
              edges: items,
              has_more: items.length === (limit ?? 50),
            };
    
            return {
              content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }],
            };
          } catch (err) {
            // EdgeStore may not exist yet (Cadence app never run).
            const msg = err instanceof Error ? err.message : String(err);
            const dbErr = {
              count: 0,
              edges: [],
              error: "edge-store-unavailable",
              detail: `Could not open EdgeStore: ${msg}`,
            };
            return {
              content: [{ type: "text" as const, text: JSON.stringify(dbErr, null, 2) }],
            };
          }
        }
      );
    }
  • Zod input schema for lifeos__read_pending_queue. Defines optional 'since' (ISO-8601 string) and 'limit' (integer 1-200, default 50) parameters.
    {
      since: z
        .string()
        .optional()
        .describe(
          "ISO-8601 timestamp — return only edges queued after this time. Omit for all pending."
        ),
      limit: z
        .number()
        .int()
        .min(1)
        .max(200)
        .optional()
        .describe("Max edges to return (default 50, max 200)"),
    },
  • Registration of the tool in the MCP server. The tool is always registered regardless of write-opt-in status, as noted by the comment 'lifeos__read_pending_queue is always accessible (no opt-in)'.
    // lifeos__read_pending_queue is always accessible (no opt-in)
    registerReadPendingQueueTool(server, ctx);
  • The pendingQueue method in TsEdgeStore that executes the SQL query against SQLite. Queries edges with review_state='proposed', ordered by formed_date DESC (or queued_since > :since if provided), with a LIMIT clause. This is the data access layer backing the tool.
    /**
     * Returns proposed edges, newest first.
     * If `since` is provided, returns only edges queued after that ISO timestamp.
     */
    pendingQueue(since?: string, limit: number = 50): Edge[] {
      if (since) {
        const rows = this.db
          .prepare(
            `SELECT * FROM edges
             WHERE review_state = 'proposed'
               AND queued_since > :since
             ORDER BY queued_since DESC
             LIMIT :limit`
          )
          .all({ since, limit }) as unknown as RawEdgeRow[];
        return rows.map(rowToEdge);
      } else {
        const rows = this.db
          .prepare(
            `SELECT * FROM edges
             WHERE review_state = 'proposed'
             ORDER BY formed_date DESC
             LIMIT :limit`
          )
          .all({ limit }) as unknown as RawEdgeRow[];
        return rows.map(rowToEdge);
      }
    }
  • src/config.ts:43-44 (registration)
    Config-level declaration that lifeos__read_pending_queue is a READ_ONLY_TOOL, always accessible without opt-in. Listed alongside WRITE_TOOL_NAMES in the health check.
    /** lifeos__read_pending_queue is always accessible — no opt-in required. */
    export const READ_ONLY_TOOLS = ["lifeos__read_pending_queue"] as const;
Behavior3/5

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

With no annotations, the description carries the burden of behavioral disclosure. It correctly states the tool is read-only and requires no write opt-in, but does not discuss edge cases (e.g., empty queue, default behavior) or potential rate limits or side effects.

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?

Extremely concise: two short sentences. Front-loaded with action and resource, no unnecessary words. Every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (2 optional params, no output schema), the description is complete. It explains what the tool does, when to use it (read-only context), and how to paginate. Sibling tools like accept_edge and reject_edge provide additional context for the queue management workflow.

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

Parameters4/5

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

Schema already covers both parameters with descriptions (100% coverage). The description adds value beyond schema by explaining how to use 'since' and 'limit' together for pagination, which is not explicitly in the schema.

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?

Description clearly specifies the verb 'List' and resource 'proposed edges waiting in the LifeOS Curator inbox'. It distinguishes itself from sibling mutation tools (accept/reject) by explicitly stating it is read-only and requires no write opt-in.

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?

Provides clear context: 'Read-only — no write opt-in required' implies when to use (viewing pending edges without needing write permissions). It also instructs to use 'since' and 'limit' for pagination, giving practical usage guidance, though it does not explicitly mention alternatives.

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/bwats/lifeos-mcp'

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