polarity_record_event
Record a structured event in your knowledge graph. Use for point-in-time occurrences like meetings, releases, or incidents.
Instructions
Record a structured event in the user's graph. Convenience wrapper over polarity_observe with kind='event'. Use for things that happened at a point in time: a meeting, a shipped release, a flight, an incident.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| source | No | ||
| tags | No | ||
| confidence | No |
Implementation Reference
- src/tools/index.ts:71-85 (registration)Tool 'polarity_record_event' is registered in the TOOLS array with its name, description, schema, and handler.
{ name: "polarity_record_event", description: "Record a structured event in the user's graph. Convenience wrapper over polarity_observe with kind='event'. Use for things that happened at a point in time: a meeting, a shipped release, a flight, an incident.", 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(), confidence: z.number().min(0).max(1).optional(), }) .strict(), handler: async (input, client) => client.observe({ ...(input as { text: string }), kind: "event" }), }, - src/tools/index.ts:75-82 (schema)Input schema for polarity_record_event: requires text string (1-4000 chars), optional source (max 64), tags (max 8 of max 32 chars each), and confidence (0-1).
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(), confidence: z.number().min(0).max(1).optional(), }) .strict(), - src/tools/index.ts:83-84 (handler)Handler for polarity_record_event: wraps client.observe() with kind='event' set, spreading the input as the body.
handler: async (input, client) => client.observe({ ...(input as { text: string }), kind: "event" }), - src/client/cosmos.ts:87-100 (helper)The client.observe() method that polarity_record_event delegates to. Sends a POST to /api/polarity/observe with the input plus polarity_user_id.
// 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 }, }); } - src/client/cosmos.ts:221-224 (helper)ObserveResponse interface: returns node_id and kind on success.
export interface ObserveResponse { node_id: number; kind: string; }