@shirbarzur/planform-mcp-server 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,40 +1,48 @@
1
1
  /**
2
- * Usage examples for the Planform MCP. Exposed via server instructions and get_usage_examples tool.
2
+ * Usage examples for the Planform MCP. Exposed via server instructions and get_usage_guide tool.
3
3
  */
4
4
  export const USAGE_EXAMPLES = `
5
5
  # Planform MCP – How to use
6
6
 
7
- ## 1. Authentication (required first)
7
+ All IDs (user, diagram, node, link) are handled by the server. You never need to pass or remember UUIDs.
8
8
 
9
- Before listing or managing diagrams, the user must authenticate:
9
+ ## Recommended flow
10
10
 
11
- 1. Call **device_start** (no arguments). A browser window opens for the user to approve.
12
- 2. After the user approves, the response includes **approved_user_uuid** and the token is stored automatically.
13
- 3. Use **approved_user_uuid** from that response as **user_uuid** in all subsequent tools (diagrams_list, diagram_create, etc.).
11
+ 1. **sign_in** (no arguments) Sign in; the browser opens for you to approve. The server remembers your session.
12
+ 2. **list_diagrams**() List your diagrams. No arguments needed.
13
+ 3. **create_diagram**({ title: "My diagram", type: "uml.class" }) – Create a diagram; it becomes the "current" one. Or **open_diagram**("My diagram") to open an existing diagram by title.
14
+ 4. **create_node**({ kind: "class", name: "User" }) – Add nodes to the current diagram. Use **node names** (e.g. "User", "Account").
15
+ 5. **create_link**({ kind: "inheritance", from: "User", to: "Account", directional: "unidirectional" }) – Connect nodes by **name** (from/to are node names). No diagram or node IDs needed.
16
+ 6. **update_node**("User", { ... }) / **delete_node**("User") – Refer to nodes by **name**. **update_link** / **delete_link** use the link_id from the response when you created the link (or from open_diagram).
14
17
 
15
- ## 2. Example: List the user's diagrams
18
+ ## 1. Sign in (required first)
16
19
 
17
- 1. **device_start** user approves in browser response includes \`approved_user_uuid\`.
18
- 2. **diagrams_list** with \`user_uuid: "<approved_user_uuid from step 1>"\`.
20
+ Call **sign_in** with no arguments. A browser window opens; approve the request. The server stores your session—you do not pass any IDs to other tools.
19
21
 
20
- Example: \`diagrams_list({ "user_uuid": "abc-123-from-device_start" })\`
22
+ ## 2. List or create diagrams
21
23
 
22
- ## 3. Example: Create a diagram and add nodes
24
+ - **list_diagrams**() Lists your diagrams (optional: status, page, page_size).
25
+ - **create_diagram**({ title: "My class diagram", type: "uml.class" }) – Creates a diagram and sets it as current. Then you can add nodes and links without specifying a diagram.
23
26
 
24
- 1. **device_start** get \`approved_user_uuid\`.
25
- 2. **diagram_create** with \`user_uuid\`, \`title\`, \`type\` (e.g. "uml.class") → returns diagram info including \`diagram_uuid\`.
26
- 3. **nodes_create** with \`diagram_uuid\`, \`kind\` ("class"|"interface"|"enum"), \`name\`, optional \`fields\` and \`methods\`.
27
- 4. **links_create** to connect nodes: use **node labels** (e.g. \`n-1\`, \`n-2\`) for \`from\` and \`to\`, **not** node UUIDs; the backend expects labels and returns 400 if given UUIDs.
27
+ ## 3. Open an existing diagram
28
28
 
29
- ## 4. Example: Fetch a diagram
29
+ - **open_diagram**("My class diagram") – Open by **title**. Omit the argument to re-load the current diagram. The opened diagram becomes current for create_node and create_link.
30
30
 
31
- 1. **device_start** (if not already authenticated).
32
- 2. **diagram_get** with \`diagram_uuid\` (from diagrams_list or diagram_create).
31
+ ## 4. Add nodes and links
32
+
33
+ - **create_node**({ kind: "class", name: "User" }) – Adds a node to the current diagram. Use **kind** (class | interface | enum), **name**, and optionally **fields**, **methods**.
34
+ - **create_link**({ kind: "inheritance", from: "User", to: "Account" }) – **from** and **to** are **node names** (e.g. "User", "Account"). The server resolves them; no node IDs or labels needed.
35
+
36
+ ## 5. Update or delete by name
37
+
38
+ - **update_node**("User", { name: "UserEntity", ... }) – First argument is the **node name**.
39
+ - **delete_node**("User") – Delete by node name.
40
+ - **update_link** / **verify_link** / **delete_link** – Use **link_id** from the response when you created the link (or from open_diagram). The server uses the current diagram.
33
41
 
34
42
  ## Summary
35
43
 
36
- - **Always call device_start first** when the user wants to list/create/edit diagrams.
37
- - **user_uuid** in API tools = **approved_user_uuid** from the device_start response.
38
- - The access token is stored by the server after device_start; you do not pass it to other tools.
39
- - **links_create**: use **node labels** (e.g. n-1, n-2) for \`from\` and \`to\`, not node UUIDs; the backend returns 400 if given UUIDs.
44
+ - Call **sign_in** first; no IDs to copy or pass.
45
+ - **create_diagram** and **open_diagram** set the "current" diagram; **create_node** and **create_link** use it automatically.
46
+ - Refer to **nodes by name** (e.g. "User") in update_node, verify_node, delete_node, and in create_link (from/to).
47
+ - **link_id** is only needed for update_link/verify_link/delete_link; get it from create_link or open_diagram response.
40
48
  `;