Canvas Node Connections
canvas.connectionsReturn the incoming and outgoing edges of a single canvas node to traverse the graph step by step without loading the full document.
Instructions
Return the incoming and outgoing edges of a single canvas node. Use this to walk the canvas graph one node at a time without loading the full document. Read-only. For full-graph parsing, use canvas.parse.
Operates on the session-active vault (see vault.current — selectable via vault.select) unless an explicit vaultPath argument is passed, which always wins.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | Vault-relative path to an Obsidian `.canvas` file. | |
| nodeId | Yes | Id of the node whose edges to return. | |
| vaultPath | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | ||
| nodeId | Yes | ||
| incoming | Yes | ||
| outgoing | Yes |
Implementation Reference
- src/schema/canvas.ts:29-36 (schema)Input schema for canvas.connections. Accepts filePath, nodeId, and optional vaultPath.
export const canvasConnectionsArgsSchema = z .object({ filePath: canvasFilePathSchema, nodeId: z.string().min(1).describe("Id of the node whose edges to return."), vaultPath: z.string().optional(), }) .strict(); export type CanvasConnectionsArgs = z.input<typeof canvasConnectionsArgsSchema>; - src/schema/canvas.ts:91-98 (schema)Output schema for canvas.connections. Returns filePath, nodeId, incoming/outgoing arrays and counts.
export const canvasConnectionsOutputSchema = z .object({ filePath: z.string(), nodeId: z.string(), incoming: z.array(z.record(z.string(), z.unknown())), outgoing: z.array(z.record(z.string(), z.unknown())), }) .passthrough();