egon-mcp
v0.2.0MCP server for creating, editing, validating and rendering Egon.io domain stories
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
create_story Create domain story
Creates a new, empty domain story with Egon's default icon set and returns its storyId. Use build_story instead to create a whole story from sentences in one call.
| Parameter | Type | Description |
|---|---|---|
title * | string | Story title. Egon 3 reads the title from the file name, so saved files are named after it. |
description | string | Text Egon shows under the title. |
scope | object | Scope of the story as shown in Egon's properties panel. |
build_story Build domain story from sentences
Creates a complete domain story in one call from numbered sentences ("Customer tells Order to Clerk"), then lays it out. Each sentence becomes one step, except that sentences given the number of an earlier step share it. Actors with the same name are one element. Each sentence draws its own work object, except that the first sentence naming a declared work object uses it and reuseWorkObject continues the previous one. Returns the storyId, the narrative and any validation issues.
| Parameter | Type | Description |
|---|---|---|
sentences * | array | The steps of the story in order. |
title * | string | Story title. Egon 3 reads the title from the file name, so saved files are named after it. |
actors | array | Actors to create first, to choose their icon or color. |
annotations | array | Notes for variations, rules and open questions. |
description | string | Text Egon shows under the title. |
groups | array | Boxes around elements that belong together, by members or by steps as add_group takes them. Groups by steps come out the same in any order: fewer steps go before more, and a group by steps takes in ev… |
layout | boolean | Arrange elements automatically (default true). |
scope | object | Scope of the story as shown in Egon's properties panel. |
workObjects | array | Work objects to create first, to choose their icon or color. The first sentence that names one uses it, and a workObjectIcon on that sentence replaces its icon; later sentences draw new ones with the… |
open_story Open story file
Opens an Egon story file (.egn, .egn.svg, or legacy .dst / .dst.svg) from the workspace directory and returns its storyId.
| Parameter | Type | Description |
|---|---|---|
path * | string | Path relative to the workspace root, as listed by list_story_files. |
import_story Import story from text
Opens a story from the text of an .egn, .dst or .egn.svg file, for example one the user pasted. Use open_story for files in the workspace.
| Parameter | Type | Description |
|---|---|---|
content * | string | The full file content. |
fileName | string | Original file name; decides how the content is read and gives the title for old files. |
list_stories List open stories
Lists the stories open in this session with their storyId, title, file path, size and whether they have unsaved changes.
close_story Close story
Closes an open story without saving it. Save first with save_story if it has unsaved changes.
| Parameter | Type | Description |
|---|---|---|
storyId * | string | Id of an open story, as returned by create_story, build_story, open_story or list_stories. |
save_story Save story to file
Writes a story into the workspace directory. For .egn and .egn.svg files it opens the written file the way open_story would: groupChangesOnOpen lists the group changes that would make, such as a shape in no group joining the smallest group box over its top-left corner, and reopenError says why the file would not open. Egon itself only reads who is in a group. The extension picks the format: .egn (Egon file), .egn.svg (image with the story embedded, importable by Egon), .svg (image only) or .md (narrative). Without a path the story goes back to the file it was opened from, or to "<title>.egn".…
| Parameter | Type | Description |
|---|---|---|
storyId * | string | Id of an open story, as returned by create_story, build_story, open_story or list_stories. |
layout | string | .egn layout: egon3 works in egon.io 3.x and Egon 4; egon4 also keeps title and scope. Default: when saving back to the file the story came from or was last saved to, the layout it last had there; else… |
overwrite | boolean | Replace an existing file that this story did not open or write, or that changed since it did. Ask the user first. |
path | string | Target path relative to the workspace root. |
list_story_files List story files
Lists Egon story files (.egn, .egn.svg, .dst, .dst.svg) in the workspace directory, skipping node_modules and hidden folders.
| Parameter | Type | Description |
|---|---|---|
directory | string | Subdirectory to search, relative to the workspace root. |
get_story Get story contents
Returns the story as actors, work objects, activities (with step numbers and names and ids of both ends), groups, annotations (with attachedTo and attachedToId for the element a note is attached to), the numbered sentences and a count of validation issues.
| Parameter | Type | Description |
|---|---|---|
storyId * | string | Id of an open story, as returned by create_story, build_story, open_story or list_stories. |
includePositions | boolean | Also return x/y of each shape. |
narrate_story Narrate story
Reads the story back as numbered sentences in Markdown, the way Egon's replay walks through it. Use it to check that the story says what the domain expert said.
| Parameter | Type | Description |
|---|---|---|
storyId * | string | Id of an open story, as returned by create_story, build_story, open_story or list_stories. |
validate_story Validate story
Checks a story for problems: errors that break the import into Egon (dangling references, actor-to-actor activities, unknown icons) and warnings that hurt readability (unnamed elements, unlabeled activities, gaps in step numbers, unconnected or overlapping elements, group boxes that enclose shapes outside the group or overlap another group).
| Parameter | Type | Description |
|---|---|---|
storyId * | string | Id of an open story, as returned by create_story, build_story, open_story or list_stories. |
set_story_info Set title, description or scope
Changes the title, description or scope of a story. Pass scope: null to clear it.
| Parameter | Type | Description |
|---|---|---|
storyId * | string | Id of an open story, as returned by create_story, build_story, open_story or list_stories. |
description | string | Text Egon shows under the title. |
scope | ||
title | string | Story title. Egon 3 reads the title from the file name, so saved files are named after it. |
add_actor Add actor
Adds an actor: a person, group or system that does something. The default icon is Person; use Group or System for those, or search_icons for others.
| Parameter | Type | Description |
|---|---|---|
name * | string | Name shown below the element, in the words of the domain. |
storyId * | string | Id of an open story, as returned by create_story, build_story, open_story or list_stories. |
color | string | Color as hex, for example #1E88E5. |
icon | string | Name of a built-in Egon icon (see search_icons) or a custom icon added with add_custom_icon. |
x | number | Left edge in Egon canvas pixels, at most a billion either way. Give x and y together, or omit both to place the element automatically. |
y | number | Top edge in Egon canvas pixels, at most a billion either way. Give x and y together, or omit both to place the element automatically. |
add_work_object Add work object
Adds a work object: something actors work with, such as a document, call, email or payment. The default icon is Document; search_icons finds others.
| Parameter | Type | Description |
|---|---|---|
name * | string | Name shown below the element, in the words of the domain. |
storyId * | string | Id of an open story, as returned by create_story, build_story, open_story or list_stories. |
color | string | Color as hex, for example #1E88E5. |
icon | string | Name of a built-in Egon icon (see search_icons) or a custom icon added with add_custom_icon. |
x | number | Left edge in Egon canvas pixels, at most a billion either way. Give x and y together, or omit both to place the element automatically. |
y | number | Top edge in Egon canvas pixels, at most a billion either way. Give x and y together, or omit both to place the element automatically. |
add_activity Add activity
Draws an activity arrow between two elements. From an actor to a work object it gets the next step number. From a work object to an actor it names the recipient and has no number. Two actors cannot be connected directly.
| Parameter | Type | Description |
|---|---|---|
from * | string | Id of an element, or the exact name of an actor, work object, group or annotation text. |
label * | string | The verb or preposition shown on the arrow. |
storyId * | string | Id of an open story, as returned by create_story, build_story, open_story or list_stories. |
to * | string | Id of an element, or the exact name of an actor, work object, group or annotation text. |
color | string | Color as hex, for example #1E88E5. |
number | integer | Join an existing step to show parallel activities. |
add_sentence Add sentence
Adds one domain story sentence as a new step: actor, verb, work object and optional recipients ("Customer tells Order to Clerk"). Actors are matched by name (case-insensitive) or created; the work object is drawn new for this sentence unless reused (see workObject).
| Parameter | Type | Description |
|---|---|---|
activity * | string | The verb, for example "orders" or "writes". |
actor * | string | Name of the actor who acts. Created if missing. |
storyId * | string | Id of an open story, as returned by create_story, build_story, open_story or list_stories. |
workObject * | string | Name of the work object. Each sentence draws a new one, as in Egon, with the icon and color of the previous one of that name. Exceptions: an id of an existing work object, reuseWorkObject, or a work o… |
actorIcon | string | Name of a built-in Egon icon (see search_icons) or a custom icon added with add_custom_icon. |
number | integer | Join an existing step (parallel activities) instead of adding a new one. |
reuseWorkObject | boolean | Use the latest work object with this name instead of drawing a new one. |
to | array | Actors who receive the work object. |
workObjectIcon | string | Name of a built-in Egon icon (see search_icons) or a custom icon added with add_custom_icon. |
add_group Add group
Draws a box around elements that belong together, such as a department or subdomain. Give members, or the step numbers of sentences as steps, and the box fits around them, holding them and the notes attached to them. An existing group whose actors and work objects are all chosen goes in whole; to put an existing group inside the new one in any case, name it in members. Named members move in from any group. The new group goes into the innermost group around the work objects of its steps, or without steps around its members, and that group grows to fit; run auto_layout when members came from dif…
| Parameter | Type | Description |
|---|---|---|
name * | string | Label in the top-left corner of the box. |
storyId * | string | Id of an open story, as returned by create_story, build_story, open_story or list_stories. |
color | string | Color as hex, for example #1E88E5. |
height | number | Box height with x and y, at most a billion pixels; default 200. Not with members or steps. |
members | array | Elements to put in the group; a name means every element with that name. The box fits around them. |
steps | array | Step numbers as narrate_story shows them (parallel sentences share one): the work objects that first appear in those sentences go into the group and their actors stay outside, the usual way to mark a… |
width | number | Box width with x and y, at most a billion pixels; default 300. Not with members or steps, whose box fits around them. |
x | number | Left edge of the box, at most a billion pixels either way. Give x and y together, and not with members or steps. |
y | number | Top edge of the box, at most a billion pixels either way. Give x and y together. |
add_annotation Add text annotation
Adds a note, optionally attached to an element with a dashed line. Use it for variations, business rules and open questions.
| Parameter | Type | Description |
|---|---|---|
storyId * | string | Id of an open story, as returned by create_story, build_story, open_story or list_stories. |
text * | string | The note. |
attachTo | string | Element the note belongs to; omit for a free-standing note. |
x | number | Left edge in Egon canvas pixels, at most a billion either way. Give x and y together, or omit both to place the element automatically. |
y | number | Top edge in Egon canvas pixels, at most a billion either way. Give x and y together, or omit both to place the element automatically. |
update_element Update element
Changes an element: rename it, change its icon or color, move or resize it, edit an annotation's text, or move an activity to another step number (the other steps shift). Pass color: "" to reset the color. As in Egon, a shape joins the group whose box it is moved into and leaves a group it is moved out of. Moving a group moves everything in it, and a moved or resized group takes in the shapes its box now covers.
| Parameter | Type | Description |
|---|---|---|
element * | string | Id of an element, or the exact name of an actor, work object, group or annotation text. |
storyId * | string | Id of an open story, as returned by create_story, build_story, open_story or list_stories. |
color | string | New color as hex, or "" to reset it. |
height | number | New height (groups and annotations), at most a billion pixels. |
icon | string | Name of a built-in Egon icon (see search_icons) or a custom icon added with add_custom_icon. |
name | string | New name or activity label. |
number | integer | Activities from an actor: move to this step; later steps shift by one. |
text | string | Text annotations: the new text. |
width | number | New width (groups and annotations), at most a billion pixels. |
x | number | New left edge (shapes only), at most a billion pixels either way. |
y | number | New top edge (shapes only), at most a billion pixels either way. |
remove_element Remove element
Removes an element. Removing an actor or work object also removes its activities; step numbers close up afterwards.
| Parameter | Type | Description |
|---|---|---|
element * | string | Id of an element, or the exact name of an actor, work object, group or annotation text. |
storyId * | string | Id of an open story, as returned by create_story, build_story, open_story or list_stories. |
renumber_steps Renumber steps
Closes gaps in the step numbers (1, 2, 3 ...) while keeping their order and parallel steps.
| Parameter | Type | Description |
|---|---|---|
storyId * | string | Id of an open story, as returned by create_story, build_story, open_story or list_stories. |
auto_layout Auto layout
Arranges actors and work objects on a grid in reading order and reroutes every arrow. It keeps the members of each group together in a block of their own below the story, nested groups and annotations in a group included, puts an actor whose arrows all lead into groups beside the group it works in most (outside the box, its notes below it, narrowed to fit), refits the group boxes, moves other annotations next to their element and moves groups without members to the end. A note goes into the group of the element it is attached to, a note on a group into that group, and notes on nothing go after…
| Parameter | Type | Description |
|---|---|---|
storyId * | string | Id of an open story, as returned by create_story, build_story, open_story or list_stories. |
add_custom_icon Add custom icon
Adds an icon that Egon does not ship, as an SVG. The story file carries the SVG, so Egon can draw it. The name must not clash with a built-in icon.
| Parameter | Type | Description |
|---|---|---|
kind * | string | Whether the icon is offered for actors or work objects. |
name * | string | Letters, digits, "-" and "_". |
storyId * | string | Id of an open story, as returned by create_story, build_story, open_story or list_stories. |
svg * | string | A complete <svg>...</svg> document, ideally with a 24x24 viewBox. |
search_icons Search icons
Finds built-in Egon icons by name or keyword, for example "car", "invoice" or "phone". Use the returned name as icon in other tools.
| Parameter | Type | Description |
|---|---|---|
query * | string | Words to look for, for example "invoice" or "delivery truck". |
limit | integer | Maximum number of results (default 10). |
list_icons List icons
Lists the names of all built-in Egon icons, plus the default icon set Egon starts with.
export_story Export story
Returns the story as text without writing a file: egn (Egon JSON), egn.svg (image with embedded story), svg (image only) or markdown (narrative). Use save_story to write a file instead.
| Parameter | Type | Description |
|---|---|---|
format * | string | egn: Egon file. egn.svg: image Egon can import. svg: image only. markdown: numbered sentences. |
storyId * | string | Id of an open story, as returned by create_story, build_story, open_story or list_stories. |
title | boolean | For svg: draw the title and description above the story (default true). |
open_in_egon Open in Egon
Serves the story from a local link and returns an Egon app URL that loads it, so the user can see and edit it in the browser. The link always serves the latest state; reload Egon after further edits. Egon may ask the browser for permission to access the local network.
| Parameter | Type | Description |
|---|---|---|
storyId * | string | Id of an open story, as returned by create_story, build_story, open_story or list_stories. |
startReplay | boolean | Start Egon's step-by-step replay right away. |