Skip to main content
Glama

polarity_observe

Write durable observations about a user into their personal graph to share context across AI agents. Log preferences, events, and project details without ephemeral chat.

Instructions

Write a freeform observation about the user into their personal graph. Cosmos runs its extractor on the text. Use this when you notice something durable about the user during a session that they would want their other AI agents to know later. Examples: stated preferences, recurring frustrations, project context, relationships. Do not log ephemeral chat content. source should identify your client (e.g. 'claude-code', 'cursor'). kind defaults to 'observation'; use 'event' for things that happened, 'preference' for stated likes/dislikes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes
sourceNo
tagsNo
kindNo
confidenceNo

Implementation Reference

  • Registration of the 'polarity_observe' tool in the TOOLS array: defines name, description, inputSchema with Zod validation, and delegates to client.observe().
    {
      name: "polarity_observe",
      description:
        "Write a freeform observation about the user into their personal graph. Cosmos runs its extractor on the text. Use this when you notice something durable about the user during a session that they would want their other AI agents to know later. Examples: stated preferences, recurring frustrations, project context, relationships. Do not log ephemeral chat content. `source` should identify your client (e.g. 'claude-code', 'cursor'). `kind` defaults to 'observation'; use 'event' for things that happened, 'preference' for stated likes/dislikes.",
      inputSchema: z
        .object({
          text: z.string().min(1).max(4000),
          source: z.string().max(64).optional(),
          tags: z.array(z.string().max(32)).max(8).optional(),
          kind: z.enum(["observation", "event", "preference"]).optional(),
          confidence: z.number().min(0).max(1).optional(),
        })
        .strict(),
      handler: async (input, client) => client.observe(input as Parameters<CosmosClient["observe"]>[0]),
    },
  • Handler function for polarity_observe: calls client.observe() with the input object, passing all validated fields (text, source, tags, kind, confidence).
    handler: async (input, client) => client.observe(input as Parameters<CosmosClient["observe"]>[0]),
  • Input validation schema for polarity_observe using Zod: requires 'text' (1-4000 chars), optional 'source' (max 64 chars), optional 'tags' (array of max 8 strings, each max 32 chars), optional 'kind' (enum: observation/event/preference), optional 'confidence' (0-1 number).
    inputSchema: z
      .object({
        text: z.string().min(1).max(4000),
        source: z.string().max(64).optional(),
        tags: z.array(z.string().max(32)).max(8).optional(),
        kind: z.enum(["observation", "event", "preference"]).optional(),
        confidence: z.number().min(0).max(1).optional(),
      })
      .strict(),
  • CosmosClient.observe() method: sends a POST request to /api/polarity/observe with polarity_user_id and the input fields (text, source, tags, kind, confidence). Returns ObserveResponse with node_id and kind.
    // Write endpoints
    observe(input: {
      text: string;
      source?: string;
      tags?: string[];
      kind?: "observation" | "event" | "preference";
      confidence?: number;
    }) {
      return this.request<ObserveResponse>({
        method: "POST",
        path: "/api/polarity/observe",
        body: { polarity_user_id: this.config.polarityUserId, ...input },
      });
    }
  • ObserveResponse type: returned by the observe endpoint, contains node_id (number) and kind (string).
    export interface ObserveResponse {
      node_id: number;
      kind: string;
    }
Behavior4/5

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

No annotations are provided, so the description bears full responsibility. It discloses that Cosmos runs an extractor on the text and that data goes into a personal graph. Missing details on persistence or side effects, but adequate for a write operation.

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?

Six sentences, front-loaded with the main purpose. Every sentence adds value: purpose, usage, examples, parameters. No repetition or fluff.

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?

No output schema is provided, and the description does not indicate what the tool returns (e.g., success confirmation, created entry ID). Given the moderate complexity and good parameter coverage, this is a notable gap. Otherwise, the description covers intent and usage well.

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 has 0% coverage, so the description compensates. It explains source ('identify your client'), kind defaults to 'observation' and other values, and mentions tags implicitly. However, it does not describe text, tags, or confidence in detail beyond schema constraints.

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 writes a freeform observation into the user's personal graph. It distinguishes from sibling tools like polarity_record_event and polarity_record_preference by mentioning 'observation' as default kind and giving examples.

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 states when to use: when noticing something durable about the user. Also provides contraindication: 'Do not log ephemeral chat content.' Examples and field guidance for source and kind further aid correct usage.

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