Skip to main content
Glama

polarity_capture_turn

Capture an entire user/assistant turn to extract all durable observations—preferences, constraints, project context, relationships, decisions, emotional signals, working-style rules—in one call.

Instructions

Hand a whole user/assistant exchange to cosmos so it can extract every durable observation worth holding (preferences, constraints, project context, relationships, decisions, emotional signals, working-style rules). PREFER this over multiple polarity_observe calls when a turn contained more than one fact about the user. Pass the user's message in user_text, your reply in assistant_text. Cosmos returns the node ids it created.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_textYes
assistant_textNo
sourceNo
max_observationsNo

Implementation Reference

  • Registration of the 'polarity_capture_turn' tool in the TOOLS array, defining its name, description, Zod inputSchema (user_text, assistant_text, source, max_observations), and handler that delegates to CosmosClient.captureTurn()
    {
      name: "polarity_capture_turn",
      description:
        "Hand a whole user/assistant exchange to cosmos so it can extract every durable observation worth holding (preferences, constraints, project context, relationships, decisions, emotional signals, working-style rules). PREFER this over multiple polarity_observe calls when a turn contained more than one fact about the user. Pass the user's message in `user_text`, your reply in `assistant_text`. Cosmos returns the node ids it created.",
      inputSchema: z
        .object({
          user_text: z.string().min(1).max(16000),
          assistant_text: z.string().max(16000).optional(),
          source: z.string().max(64).optional(),
          max_observations: z.number().int().min(1).max(20).optional(),
        })
        .strict(),
      handler: async (input, client) =>
        client.captureTurn(input as Parameters<CosmosClient["captureTurn"]>[0]),
    },
  • Handler function for polarity_capture_turn: passes the input to client.captureTurn() which sends a POST to /api/polarity/capture-turn
    handler: async (input, client) =>
      client.captureTurn(input as Parameters<CosmosClient["captureTurn"]>[0]),
  • Input schema for polarity_capture_turn: validates user_text (string 1-16000), optional assistant_text (max 16000), optional source (max 64 chars), optional max_observations (int 1-20)
    inputSchema: z
      .object({
        user_text: z.string().min(1).max(16000),
        assistant_text: z.string().max(16000).optional(),
        source: z.string().max(64).optional(),
        max_observations: z.number().int().min(1).max(20).optional(),
      })
      .strict(),
  • CosmosClient.captureTurn() method: sends a POST request to /api/polarity/capture-turn with polarity_user_id and the input fields, returns a CaptureTurnResponse
    captureTurn(input: {
      user_text: string;
      assistant_text?: string;
      source?: string;
      max_observations?: number;
    }) {
      return this.request<CaptureTurnResponse>({
        method: "POST",
        path: "/api/polarity/capture-turn",
        body: { polarity_user_id: this.config.polarityUserId, ...input },
      });
    }
  • CaptureTurnResponse interface: defines the return type with 'created' (array of {node_id, kind, label}), 'extracted' (count), and 'skipped' (count)
    export interface CaptureTurnResponse {
      created: Array<{ node_id: number; kind: string; label: string }>;
      extracted: number;
      skipped: number;
    }
Behavior4/5

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

With no annotations, the description carries full burden. It discloses that the tool returns node ids created in cosmos and extracts observations, but does not mention side effects, idempotency, or rate limits. Still, it gives sufficient behavioral cues for an AI agent.

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 to three sentences, front-loading the purpose and usage. Every sentence adds value, making it efficient and easy to parse.

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

Completeness4/5

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

Despite lacking output schema, it tells what the tool returns (node ids). It covers main usage and purpose. However, it omits details on optional parameters and potential edge cases, but given the tool's simplicity, it is reasonably complete.

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 explain parameters. It explains user_text and assistant_text clearly, but leaves source and max_observations undocumented. Thus, only half the parameters are semantically covered.

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 the tool captures a whole user/assistant exchange to extract durable observations, listing specific types like preferences and constraints. It distinguishes itself from the sibling tool polarity_observe, making the purpose unambiguous.

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

Usage Guidelines5/5

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

Explicitly advises to prefer this over multiple polarity_observe calls when a turn contains more than one fact, and instructs how to pass user_text and assistant_text. This provides clear when-to-use and how-to-use guidance.

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/teampolarity/cosmos-mcp'

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