PKM Link¶
Maintains the graph by adding, refining, or correcting relations between AnyType objects.
When to use¶
- "Link X to Y" / "this person is part of project Z" / "this event was about idea Q".
- Wiki lint finds orphan objects (no inbound or outbound relations).
- Inbox entry promoted to a typed object — wire its relations.
- Cross-linking a wiki page's AnyType object to related objects.
What you produce¶
- Updated relations on existing AnyType objects.
- Updated
related:frontmatter in wiki pages where applicable. - Audit-log entries per write.
MCP tools used¶
mcp__anytype__API-search-space— find objects by name and typemcp__anytype__API-get-object— read current property values before updatingmcp__anytype__API-update-object— write the new relation
Procedure¶
- Identify the two ends. Use
mcp__anytype__API-search-spaceto locate objects by name + type. - If multiple matches, ask the user to disambiguate.
- Note both object IDs before proceeding.
- Choose the relation property. Per
schemas/object-types.md:
| Relation | Property key | Format | Directionality |
|---|---|---|---|
| Person → Person (manager) | reports_to |
objects | directed — set on the report, pointing at the manager. Do NOT mirror. |
| Person ↔ Person (peer) | collaborates_with |
objects | symmetric — set on both ends |
Person ↔ Project (pkm_project) |
affiliations |
objects | symmetric |
| Person ↔ Event | participants |
objects | symmetric |
| Idea ↔ Idea | related_ideas |
objects | symmetric |
Idea ↔ Project (pkm_project) |
related_projects |
objects | symmetric |
| Idea ↔ Source (Bookmark) | provoked_by |
objects | symmetric |
Event ↔ Project (pkm_project) |
related_projects |
objects | symmetric |
⚠️ Custom Project type key is pkm_project, not project.
⚠️ reports_to is directed — do not mirror it. "A reports to B" sets reports_to=[...,B] on A only. Writing the reverse on B would corrupt the org-chart direction the graph export depends on (reports_to → directed WORKS_FOR edge A→B). collaborates_with is the symmetric peer relation and is written on both ends. See the graph-export semantics note in schemas/object-types.md.
⚠️ Page ↔ Page links cannot be set via API. AnyType's built-in links property is system-managed and read-only — setting it returns HTTP 400. Markdown body links are stored as text but do NOT populate the links graph property. For wiki cross-links between Page-type objects: update related: frontmatter in the markdown file and add a "Related" section in the object markdown body via update-object. The AnyType object graph will not reflect these until a user creates @ mentions in the UI.
- Read before write. Call
mcp__anytype__API-get-objecton the object being updated. - Extract the current value of the target property (it may already have entries).
- ⚠️
update-objectreplaces property values, not appends. Always build the full new list:[...existing_ids, new_id]. - Write the link via
mcp__anytype__API-update-object. - Set the property to the full updated list of object IDs.
- Repeat for the other end if the relation should be bidirectional.
- Update wiki frontmatter (if either object has a corresponding wiki page):
- Add
anytype:<object_id>to therelated:list in the relevant markdown file if not already present. - Audit log entry in
audit-log.md. Action:link. - If a Project gained a new linked Idea, check whether the link implies new
acceptance_criteria. Ask the user before writing.
Anti-patterns¶
- Don't guess which Person/Event/Idea matches — always disambiguate.
- Don't create new objects in this skill — that's what
pkm-captureis for. - Don't link across data classifications without verifying runtime policy compatibility.
- Don't overwrite existing
objectsproperty values — read first, then write the merged list. - Don't mirror
reports_to— it is directed (report → manager only). Mirroring inverts the org-chart edge. - Don't use
type_key: project— usepkm_project. - Don't attempt to set the
linksproperty directly — it is reserved and will 400.
Compatibility¶
- Requires AnyType Local API + MCP server configured.
- Requires the agent-scoped key.
- Local-only.