API Reference

Complete reference for the Metapad MCP API tools.

mutation

add_allowed_connectionv1.0

Define an allowed connection pattern between node types for a relationship type. All three (relationship type, source node type, target node type) must already exist in the metamodel. Use get_metamodel to check existing types.

add_node_typev1.0

Add a new node type (entity type) to the metamodel. Do this before creating nodes of that type. You can define custom properties with data types.

add_relationship_typev1.0

Add a new relationship type to the metamodel. After creating it, use add_allowed_connection to specify which node types can be connected with it.

add_relationships_to_diagramv1.0

Auto-show all relationships between elements already placed on a diagram. For model diagrams shows M1 relationships; for metamodel diagrams shows allowed connections. Applied immediately.

add_to_diagramv1.0

Add nodes or node types to a diagram with auto-grid layout. For model diagrams use node IDs or auto-IDs (e.g. REQ-1); for metamodel diagrams use node type IDs. Applied immediately.

create_diagramv1.0

Create a new diagram for visualizing model elements. Use diagram_type 'metamodel' for M2 type diagrams, 'model' for M1 instance diagrams. Applied immediately.

create_filterv1.0

Create a stored filter with a composable expression. Expressions: {"OfType":{"type_id":"<id>"}}, {"HasTag":{"tag":"foo"}}, {"NameMatches":{"operator":"Contains","value":"foo"}}, {"And":[...]}, {"Or":[...]}, {"Not":expr}, {"InFolder":{"folder_id":"<id>","recursive":true}}, or "All". Applied immediately.

create_folderv1.0

Create a new folder for organizing model elements. Use layer 'metamodel' for node/relationship type folders, 'model' for node/relationship/diagram folders. Applied immediately.

create_nodesv1.0

Create new node instances. Node type must already exist in the metamodel (use get_metamodel to check, or add_node_type to create). Changes are applied immediately and broadcast to all connected browser users in real-time.

3 parameter(s)

create_relationshipsv1.0

Create relationships between existing nodes. Both source and target must exist. The relationship type must exist in the metamodel and have an allowed connection defined for the given source/target node types.

delete_diagramv1.0

Delete a diagram and all its element placements. Does NOT delete the underlying nodes or relationships — only the visual representation. Applied immediately.

delete_filterv1.0

Delete a stored filter. Does not delete any model data. Applied immediately. Accepts filter ID or name.

delete_nodesv1.0

Delete one or more nodes. By default, all connected relationships are also deleted (cascade). Set cascade_relationships to false to fail if the node has any relationships.

2 parameter(s)

delete_relationshipsv1.0

Delete one or more relationships by their IDs. Use get_relationships to find the relationship IDs first.

merge_nodesv1.0

Merge duplicate nodes into a single node. All relationships from merged nodes are redirected to the kept node. The merged nodes are then deleted. Use find_similar_nodes to identify candidates.

1 parameter(s)

move_to_folderv1.0

Move model elements into a folder (or to root by omitting folder_id). Supports nodes, relationships, node types, relationship types, diagrams, and folders. Applied immediately.

remove_allowed_connectionv1.0

Remove an allowed connection constraint, revoking permission for a relationship type to connect specific node type pairs. Applied immediately.

remove_from_diagramv1.0

Remove nodes or node types from a diagram. Also removes connected relationship visualizations on that diagram. Does NOT delete the underlying elements. Applied immediately.

remove_node_typev1.0

Remove a node type from the metamodel. Also cascades to remove all M1 instances of that type and their relationships. Applied immediately. Use with caution — cannot be undone via MCP.

remove_relationship_typev1.0

Remove a relationship type from the metamodel. Also removes all relationships of that type from M1. Applied immediately. Use with caution.

rename_folderv1.0

Rename an existing folder and optionally update its description. Applied immediately.

update_diagramv1.0

Update an existing diagram's name or description. Applied immediately. Accepts diagram ID or name.

update_modelv1.0

Update the model's top-level name or description. Applied immediately.

update_node_typev1.0

Update an existing node type: rename, recolor, change description, or add new properties. Applied immediately and broadcast to all connected users.

update_nodesv1.0

Update labels, descriptions, or properties on existing nodes. Use set_label/set_description to update core fields, set_properties for key-value pairs, and remove_properties to clear values. Node IDs accept both UUIDs and auto-IDs (e.g. REQ-42).

1 parameter(s)

update_relationship_typev1.0

Update an existing relationship type: rename, recolor, change description, or add new properties. Applied immediately and broadcast to all connected users.

update_relationshipsv1.0

Update labels, descriptions, or properties on existing relationships. Applied immediately and broadcast to all connected users. Relationship IDs accept both UUIDs and auto-IDs (e.g., "CON-5").

update_tagsv1.0

Update tags on any model element (node, relationship, node type, relationship type, diagram, or folder). Replaces all existing tags. Applied immediately.

read