polarity_get_graph
Read your knowledge graph to examine self-image, the system's perspective, or the polarity alignment between the two.
Instructions
Read the user's graph view. entity selects which projection: 'user' (the user's self-graph), 'cosmos' (the cosmos entity's view of them), or 'polarity' (the dyadic synchronization between the two). Use 'user' for general questions about what the user thinks, does, or knows. Use 'polarity' when comparing the user's self-image against the system's observation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entity | No |
Implementation Reference
- src/tools/index.ts:37-40 (handler)The handler function for polarity_get_graph. It extracts the optional 'entity' parameter and delegates to CosmosClient.getGraph().
handler: async (input, client) => { const { entity } = input as { entity?: "user" | "cosmos" | "polarity" }; return client.getGraph(entity); }, - src/tools/index.ts:32-36 (schema)Input schema for polarity_get_graph: optional 'entity' enum with values 'user', 'cosmos', or 'polarity'.
inputSchema: z .object({ entity: z.enum(["user", "cosmos", "polarity"]).optional(), }) .strict(), - src/tools/index.ts:28-41 (registration)Registration of the 'polarity_get_graph' tool in the TOOLS array, with its name, description, schema, and handler.
{ name: "polarity_get_graph", description: "Read the user's graph view. `entity` selects which projection: 'user' (the user's self-graph), 'cosmos' (the cosmos entity's view of them), or 'polarity' (the dyadic synchronization between the two). Use 'user' for general questions about what the user thinks, does, or knows. Use 'polarity' when comparing the user's self-image against the system's observation.", inputSchema: z .object({ entity: z.enum(["user", "cosmos", "polarity"]).optional(), }) .strict(), handler: async (input, client) => { const { entity } = input as { entity?: "user" | "cosmos" | "polarity" }; return client.getGraph(entity); }, }, - src/client/cosmos.ts:71-77 (helper)CosmosClient.getGraph() makes a GET request to /api/polarity with the optional entity query param and returns a GraphResponse.
getGraph(entity?: "user" | "cosmos" | "polarity") { return this.request<GraphResponse>({ method: "GET", path: "/api/polarity", query: { entity }, }); } - src/client/cosmos.ts:204-213 (schema)Response type for getGraph, containing nodes, edges, orbit_edges, communities, observations, user, cosmos, and sync_edges fields.
export interface GraphResponse { nodes: PolarityNode[]; edges?: PolarityEdge[]; orbit_edges?: PolarityEdge[]; communities?: unknown[]; observations?: unknown[]; user?: unknown; cosmos?: unknown; sync_edges?: unknown[]; }