convexity-mcp
v0.12.4Build, edit, solve and analyse Convexity energy-system models from any MCP client; drives the app.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_component
Get a component and all its attributes (values and storage types), looked up by name, INCLUDING which bus(es) it connects to (bus/bus0/bus1, by id and name where set). Use this to inspect a component before changing it — never guess a component's bus from its name.
| Parameter | Type | Description |
|---|---|---|
component_name * | string | Name of the component (e.g. 'Gen2', 'Solar_Farm') |
list_projects
The projects the user can open and which project and model are open now. A project holds the user's models and the project's Files, shared with its members; a model is one energy system in it.
open_in_app
Open a model in the Convexity app (starting the app when nothing is running) and work on it from here on. Name it, with project when the name repeats across projects, or pass its id; list_projects lists them. When the name is in several projects and the user named none, ask which before opening either. path imports a model file on this computer (a Convexity .db, a PyPSA NetCDF .nc or a Convexity workbook .xlsx) into the project as a new model; a large file can take minutes, and asking again with the same path waits for that import rather than starting another. create makes a new, empty model c…
| Parameter | Type | Description |
|---|---|---|
again | boolean | With path: import it even when the project has a model of that name. |
create | object | A new, empty model called name. |
model_id | string | |
name | string | The model's name as the app shows it. With path: the name for the imported model (default: the file name without its extension). |
path | string | Absolute path on this computer to a .db, .nc or .xlsx: imported as a new model (with create and no app: the .db the new model goes in). |
project | string | The project holding it (name or id). Default: the open project. |
create_project
Make a new project, when the user asks for one, and work in it; open_in_app with create (or path, to import a model file) then starts its first model, and write_project_file adds to its Files. Ask the user for a name if they gave none. Never make one only to have somewhere to work: list_projects shows the ones they have. example starts it as a copy of one of the Examples list_projects shows, named name.
| Parameter | Type | Description |
|---|---|---|
name * | string | The new project's name. |
example | string | Start from this example project, by name; list_projects shows the examples. |
rename_model
Rename a model of the app; every tab, list and dashboard follows. A name another model of the project has comes back as "Name (2)".
| Parameter | Type | Description |
|---|---|---|
name * | string | The model's name, or its id. |
to * | string | The new name. |
project | string | The project holding it, when the name repeats across projects. |
delete_model
Delete a model of the app for every member of the project, with its scenarios and runs; a synced project can bring it back from Project History. Ask before deleting one the user did not name.
| Parameter | Type | Description |
|---|---|---|
name * | string | The model's name, or its id. |
project | string | The project holding it, when the name repeats across projects. |
save_version
Save the whole project as it stands (every model, file and dashboard) as a named version in Project History: before a large or risky change, or when the user asks for a checkpoint.
| Parameter | Type | Description |
|---|---|---|
name * | string | What the version marks. |
project | string | Project name or id; the open project when absent. |
restore_version
Put the whole project back as a version held it (every model, file and dashboard; anything added since is removed, and a file goes to the Bin), only when the user asks to undo or go back; it always waits for their approval. version is an id or name from history (of "versions"). Edits not yet in a version are saved first, and the restore is itself a version, so it can be undone by restoring the one before. The restore runs on the server and takes up to a minute: this waits briefly, and if status is still "pending" read history (of "versions") until it says done or failed. Which version is meant…
| Parameter | Type | Description |
|---|---|---|
version * | string | Version id or name. |
project | string | Project name or id; the open project when absent. |
search_docs
Search the Convexity product documentation for how features work. Use when the user asks how to do something in Convexity or how a concept works.
| Parameter | Type | Description |
|---|---|---|
query * | string | |
top_k | integer |
get_model_summary
Overview of the open model: counts and capacity by type and carrier, scenarios, documents, values worth checking. aggregate:false lists each component with its bus and key inputs, for a review. For results, get_results. include adds: config (discount rate, solver, periods, currency), carriers.
| Parameter | Type | Description |
|---|---|---|
aggregate | boolean | false: each component too (up to 500). |
component_type | string | With aggregate:false, only this type. |
include | array |
set_network_config
Set one model-level parameter (e.g. discount_rate, unmet_load_active, or currency: the code the app labels money with, e.g. EUR) in the scenario named, as for any edit. How a scenario solves (solver, representative days, horizon) is run_settings.
| Parameter | Type | Description |
|---|---|---|
param_name * | string | Parameter to set (e.g. 'discount_rate', 'solver_name', 'unmet_load_active'). |
param_type * | string | The value type. |
param_value * | string | The value, as a string (e.g. "0.05", "highs", "true"). Coerced to param_type by the backend. |
scenario_id | string | Required: where the change goes. A what-if scenario by name or id (create_scenarios makes one), or "base" for the model itself, only when the user asked to change the model. |
run_settings
How a scenario solves: solver, horizon (perfect foresight, representative days, rolling horizon) and solver options. Without set, reads the model's settings and each scenario's own. set changes one scenario (named, as for any edit; "base" is the model, only when the user asked), over the model's settings; reset true makes it follow the model's again. Nothing runs.
| Parameter | Type | Description |
|---|---|---|
reset | boolean | |
scenario_id | string | Required: where the change goes. A what-if scenario by name or id (create_scenarios makes one), or "base" for the model itself, only when the user asked to change the model. |
set | object |
list_validation_rules
The attribute vocabulary. With no filter: an index — per component type, the attribute groups and attribute names (cheap; start here). Pass component_type for that type's rules (data type, unit, default, required, input vs result, timeseries allowed), optionally narrowed by group_name.
| Parameter | Type | Description |
|---|---|---|
component_type | string | e.g. 'GENERATOR', 'LOAD', 'LINK', 'STORAGE_UNIT', 'BUS' — omit for the index. |
group_name | string | Only rules in this group (group names come from the index). |
names_only | boolean | With component_type: return attribute names only. |
list_scenarios
List all scenarios defined in the network, including their run status and descriptions. By default the 'Actual' scenario is excluded. Set include_actual=true when the user asks about actuals data or wants to compare actuals against other scenarios. Pass changes_for (a scenario id or name) for what that scenario changes: every input it sets, with the base value beside it; with against (another scenario), where the two differ instead.
| Parameter | Type | Description |
|---|---|---|
against | string | |
changes_for | string | A scenario id or name: list what it changes instead. |
include_actual | boolean | If true, include the 'Actual' scenario. Default is false. |
limit | integer | |
offset | integer |
add_components
Add components, many per call, of any type: BUS (with latitude and longitude), GENERATOR, LOAD, STORAGE_UNIT, STORE, LINK, LINE, TRANSFORMER. Buses in the same call come first, so a build can add buses and what connects to them together. A carrier the model lacks is created. scenario "base" builds into the model itself (every scenario sees it); a scenario adds them off in the base and on there (a what-if). Values are static inputs, e.g. {"p_nom": 100, "max_hours": 4}; fill series (p_set, p_max_pu) with set_series after. The reply lists each one made, inputs refused, and inputs left at a defaul…
| Parameter | Type | Description |
|---|---|---|
components * | array | |
scenario * | string | "base" to build the model, or a what-if scenario. |
source | object | The project file the values came from. |
edit_components
Rename components, move them to another bus (or a bus on the map), change their carrier, or delete them (delete: true; a bus with components on it also needs with_connected: true). Changes the model itself, for every scenario. Values go through set_values.
| Parameter | Type | Description |
|---|---|---|
components * | array |
edit_carriers
Create, change or delete carriers: co2_emissions (tCO2 per MWh of fuel), max_growth (MW of new build allowed over the horizon; null for no limit), nice_name (display name), color. A carrier not in the model is created; delete: true removes one nothing uses. Carriers belong to the whole model, so every scenario sees the change.
| Parameter | Type | Description |
|---|---|---|
carriers * | array |
fill_weather
Wind and solar capacity factor profiles (p_max_pu) at each generator's location from Renewables Vision, Convexity's own weather service (ERA5, 1940 to last year): to fill a model's profiles, or for weather sensitivities. One year goes in scenario ("base" for the model itself, else made if new); several years make an ensemble, one scenario per year named "<ensemble>/<year>". preview: compare years' average capacity factors without changing anything, e.g. to find the stillest year; for "how sensitive is it to the weather", preview, then offer an ensemble. Defaults to every wind and solar generat…
| Parameter | Type | Description |
|---|---|---|
years * | array | Weather years, e.g. [2018, 2019, 2020]. |
components | array | Only these generators. |
ensemble | string | Several years: the ensemble's name (default "Weather"). |
preview | boolean | Only report each year’s average capacity factors. |
scenario | string | One year: the scenario to write into, by name or id, made if new; "base" only when the user asked to change the model itself. |
solar_model | string | |
tech | string | Which generators, by carrier. Default both. |
wind_model | string |
run_model
Solve the open model as the Run button does, where the model's solver setting says (local on this computer, free; or the Convexity cloud, paid): use it without asking unless the user names one. A cloud run needs the user's go-ahead, then pass confirm_cloud. Every run is recorded; its results become the current results of the scenarios it solved. Do not edit the model while it runs.
| Parameter | Type | Description |
|---|---|---|
confirm_cloud | boolean | Required true for a cloud run: the user agreed to pay. |
representative_days | object | Capacity expansion on representative days (time-series aggregation) for this run: decide what to build on a few representative days of each year, then dispatch every hour with that fleet. Pass {} for… |
scenario_ids | array | Scenarios to solve, by id or name; "base" or null for the base network. Omit for the open scenario. |
timeout_seconds | integer | |
wait | boolean | Block until the run ends and its results are in. |
where | string | Default: the model's solver setting. |
runs
The open model's runs, newest first: status, when, and which scenarios' current results each holds. Pass run_id for one run's status and error, and logs: true for the end of its solver log (cloud runs keep one; a local run does not).
| Parameter | Type | Description |
|---|---|---|
limit | integer | |
logs | boolean | |
run_id | string |
cancel_run
Cancel a run of the open model: a cloud run, or a local run solving on this computer.
| Parameter | Type | Description |
|---|---|---|
run_id * | string |
show_in_app
Switch the app to a page (overview is the Model page, results is Analytics, docs is the project's Files) or tab; table opens Tables on a component type, set up. To put one thing on screen use show_address.
| Parameter | Type | Description |
|---|---|---|
page | string | |
tab | string | A tab of the Model page (implies page: overview). |
table | object | Tables on one component type, set up. Columns by id or header. |
show_address
Show the user something in the Convexity app by its address — the same token mentions use: a component on the map or in the grid ("[[component:generator/Tuas CCGT]]", "[[component:load/City|in=table]]"), a value in the grid or a series at a moment ("[[value:load/City|attr=p_set|at=2030-01-01T05:00]]"), a scenario ("[[scenario:High gas]]"), a dashboard ("[[dashboard:Results/Costs]]"), a deck ("[[deck:Q3 Review]]"), an analysis ("[[analysis:Loss of load]]"), an analysis run's page ("[[analysis_run:<run id>]]"), one card on its dashboard ("[[analysis_run:<run id>|card=<card id or title>]]") or…
| Parameter | Type | Description |
|---|---|---|
address * | string | The address token, with or without the surrounding [[ ]]. |
ui_state
What the user is looking at in the Convexity app, in names: the page and tab, the open tab, the table and its rows, the scenario, and what is selected on the map. Cheap; call it before deciding what to show, or when the user says "this", "these" or "here".
read_table
The rows the Tables grid in the app shows, as tab-separated text: to check what the user sees, or that an edit reached the screen. With type it opens that table if it is not on screen; filter and sort set the table up on screen first, as show_in_app({table}) does.
| Parameter | Type | Description |
|---|---|---|
columns | array | |
filter | object | column → text, number, list of values, or {min, max}; {} clears |
limit | integer | |
sort | object | |
type | string | Default: the table on screen. |
read_skill
Working notes for a kind of task (a health check, scenarios and sensitivities, dashboards and decks, analysing results), from the app's skills. Without name, lists them; read the one that covers a task before doing it the first time.
| Parameter | Type | Description |
|---|---|---|
name | string | A skill name. |
set_user_expertise
Record the user's experience of energy modelling (sets how much you explain) when they say it, or, once you can tell, with inferred: true.
| Parameter | Type | Description |
|---|---|---|
level * | string | |
inferred | boolean |
list_project_files
The project's Files as JSON, a page at a time: its documents, data and code, shared by every model. prefix narrows to a folder ("docs/"); deleted lists the Bin.
| Parameter | Type | Description |
|---|---|---|
deleted | boolean | |
limit | number | |
offset | number | |
prefix | string | |
project | string |
read_project_file
Read a project file by path (or id): text, Markdown, CSV and code as lines; a spreadsheet as rows of one sheet; a PDF as text page by page, to cite; an image as the picture. pages ("3", "2-5"), lines ("1-200") and sheet choose a part; the first by default. A CSV or sheet also gives each numeric column's mean, min and max over every row.
| Parameter | Type | Description |
|---|---|---|
id | string | |
lines | string | |
pages | string | |
path | string | |
project | string | |
sheet | string |
search_project_files
Search the project's Files for a phrase or words: text, Markdown, CSV, code and small PDFs on this device. Each hit has the file, page or line, and a ready [[source:…]] citation; read_project_file gives the context.
| Parameter | Type | Description |
|---|---|---|
query * | string | |
prefix | string | |
project | string |
write_project_file
Write a text file to the project: a note, a CSV table, a write-up. A new path is created, folders included. from_results takes a get_results query and writes its whole table as CSV, uncapped. To change a file, pass expected: the sha256 read_project_file gave; if it changed since, the write is refused, so read it again. overwrite: true replaces it unread, only when told to. Never write keys: every member reads Files.
| Parameter | Type | Description |
|---|---|---|
path * | string | e.g. "notes/assumptions.md" |
expected | string | |
from_results | object | |
overwrite | boolean | |
project | string | |
text | string |
edit_project_file
Change part of a text file without retyping it: each edit replaces old_text, which must occur exactly once (include enough lines to make it unique), with new_text. Use it for any change to a long file, such as an analysis's script or overview; write_project_file replaces a whole file. The edits apply in order, all or none.
| Parameter | Type | Description |
|---|---|---|
edits * | array | |
path * | string | |
project | string |
organise_project_files
Sort the project's Files, in order, stopping at the first failure: mkdir {path}; move {path, into} ("" = top level); rename {path, name}; delete {path}, a file or a folder, to the Bin. Delete only what the user asked to remove.
| Parameter | Type | Description |
|---|---|---|
operations * | array | |
project | string |
draft_visuals
Write a first dashboard and deck for an analysis from a completed run's outputs: numbers as a Kpis strip, each table as a Table (or a TimeSeries over its hour or time column), a slide per group. Files go beside analysis.py; refine them as read_skill make-visuals says. Refuses to replace a template there unless overwrite.
| Parameter | Type | Description |
|---|---|---|
analysis * | string | Name or path. |
overwrite | boolean | |
run | string | A run id; default its latest completed run. |
get_sources
Where the model's input values came from: each source cites a spot in a project file or a web page, for one value in one scenario. Narrow by component, type, attribute or file; scenario shows the sources backing what that scenario uses. Warnings say when the value or the file has changed since the source was added. unsourced: true instead lists the values set with no source, and how many are sourced by type.
| Parameter | Type | Description |
|---|---|---|
attribute | string | e.g. "capital_cost". |
component | string | Component name. |
file | string | Sources citing this file path. |
limit | number | Unsourced values listed; default 100. |
scenario | string | Scenario name. Absent or "base": the base network, whose source also backs a scenario that keeps the base value. |
type | string | Component type, e.g. GENERATOR. |
unsourced | boolean |
add_source
Record where one input value came from, so anyone can check it. Only for a value you, or the user, took from that source. A project file is cited with the [[source:…]] token read_project_file or search_project_files gives: a quote must be the exact words in the file, and is refused otherwise. A web page needs its url and title. One value in one scenario per call, or many in one: items, each with these same fields.
| Parameter | Type | Description |
|---|---|---|
accessed_on | string | When the page was read, YYYY-MM-DD. Default: today. |
attribute | string | e.g. "capital_cost". |
bus | string | |
carrier | string | |
cite | string | A project file: [[source:<path>|p=<page>|q=<exact words>]], |sheet=…|range=… for a spreadsheet, or just the path for the whole file. |
component | string | Component name. |
component_type | string | |
items | array | Many sources in one write, each {component, attribute, …}; cite, url, note, scenario or attribute given beside items count for every item. Or component_type, carrier and/or bus in place of items: a… |
note | string | How the value follows, e.g. "converted from $/kW". |
quote | string | The words on the web page that give the value. |
scenario | string | Scenario name. Absent or "base": the base network, whose source also backs a scenario that keeps the base value. |
title | string | The web page's title. |
url | string | A web page, https://… |
remove_source
Remove a source by the id get_sources gives. Only with the user's word, or to replace one you added in error.
| Parameter | Type | Description |
|---|---|---|
id * | string |
list_comments
The project's comment threads: who said what, and where (a table cell as type › component › attribute, a file and its spot, or a dashboard card as dashboard › chart). Open threads by default. Narrow by file path, component name or dashboard name. Reply or resolve by a thread's id.
| Parameter | Type | Description |
|---|---|---|
component | string | Only threads on this component, by name. |
dashboard | string | Only threads on this dashboard's cards, by name. |
file | string | Only threads on this file path. |
limit | integer | |
offset | integer | |
status | string | Which threads: open (default), resolved or all. |
add_comment
Comment where people will see it, under the name Convexity: reply in a thread (reply_to: a comment's id from list_comments), or start one on a project file (file, with spot for a page, a sheet range, a row or a quoted passage), on a value in the open model (component and attribute, and scenario when it is about one), or on a dashboard card (dashboard and chart). Many at once: items, each with the same fields, or component_type, carrier and/or bus for one comment on each component they pick. Comment only when asked to, or to flag something a person should check.
| Parameter | Type | Description |
|---|---|---|
attribute | string | The value commented on, e.g. "p_nom". |
body | string | What to say. Plain text. |
bus | string | |
carrier | string | |
chart | string | The chart drawn on that dashboard, by name. |
component | string | Component name. |
component_type | string | |
dashboard | string | A dashboard name; with chart, the card the comment is on. |
file | string | A project file path. |
items | array | Many comments in one call, each {body, component, attribute, scenario}, {body, file, spot} or {body, dashboard, chart}. |
reply_to | string | A comment id: the reply goes in its thread. |
scenario | string | Scenario name; absent or "base" for the base network. |
spot | object | Where in the file: {page} for a PDF, {sheet, range} for a spreadsheet ("C4:D6"), {row, column} for a CSV, {quote} for a passage of text. |
resolve_comment
Resolve a comment thread once what it raised is done, or reopen it (resolved: false). Any comment id in the thread will do.
| Parameter | Type | Description |
|---|---|---|
id * | string | A comment id from list_comments. |
resolved | boolean | false reopens it. Default true. |
sanity_check
Run a read-only validation bundle against the current model DB. Returns { passed, issues, warnings, info } where each entry is { check, message }. Issues are blocking (solve will likely fail); warnings are non-fatal. Use this before solving to catch common configuration mistakes.
list_constraints
List all constraints in the network, including their active status and language.
create_constraint
A custom constraint, applied when the model solves. For one scenario only, create it with is_active false, then edit_constraint active true in that scenario. DSL (recommended, constraint_language='dsl'): `SUM(Generator.p WHERE carrier = "coal") <= 0.3 * DEMAND()`, `SUM(Generator.p_nom_opt WHERE carrier = "solar") >= 500`, `TOTAL(Generator.p WHERE carrier = "gas") <= 1000000` (MWh); SUM, TOTAL, COUNT, DEMAND(), EMISSIONS(), WHERE carrier/bus, FOR EACH PERIOD/BUS/DAY/WEEK/MONTH, >= <= ==. Python (constraint_language='python'): code on the network `n` (its optimisation model is `n.model`), with `…
| Parameter | Type | Description |
|---|---|---|
name * | string | Name of the constraint (e.g. 'Min Wind Generation', 'CO2 Cap') |
check_only | boolean | |
constraint_code | string | The constraint code in DSL or Python |
constraint_language | string | Language of the constraint code |
description | string | Optional description of the constraint |
is_active | boolean | Whether the constraint is active (default true) |
priority | integer | Execution priority (lower = earlier, default 0) |
template | object |
edit_constraint
Change a constraint by name: constraint_code replaces its code (checked first); active switches it on or off in scenario ("base" for the model itself); delete: true removes it, only with the user's word.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
active | boolean | |
constraint_code | string | |
delete | boolean | |
scenario | string |
assess_model
The model as an analyst sees it: size, dimensions with values (carriers, scenarios, time config), which scenarios are solved, its problem type, and the metrics it can produce (available_metrics) or not (unsupported_metrics). For a question about what a model can answer; not needed before get_results, which reads results directly and names what it cannot answer.
get_results
Any solved result, or a model input (input_capacity, input_demand, availability: no run needed), as one table in one unit (columns, then rows; with 2+ dimensions carriers, components or buses become columns). Name a metric, split it with by, pick scenarios (["solved"] for every solved one; default the open one). year = investment period. E.g. {metric:"capacity", by:["year","carrier"], scenarios:["solved"]}; {metric:"price", by:["time"], time:{every:"month"}} (every:"duration" for a duration curve); one day: {metric:"generation", by:["time","carrier"], time:{from:"2040-07-07"}}. Metrics: capaci…
| Parameter | Type | Description |
|---|---|---|
metric * | string | One metric name from the list. |
base_year | integer | |
buses | array | Only these buses (names or ids). |
by | array | Dimensions to split by. Empty = one total per scenario. |
carriers | array | Only these carriers (display names). |
components | array | Only these components (names). |
include_zero | boolean | Keep zero rows. |
layout | string | wide (default): with 2+ dimensions, carriers (or components, buses) become columns. long: one row per value. |
rate | number | |
scenarios | array | Scenario names or ids, "base", or ["solved"] for every solved scenario. Default: the open scenario. |
time | object | With by "time": every = step|hour|day|week|month|year|duration|histogram (default chosen by span); how = sum|mean|min|max. from / to ("2040-07-07", or "2040-07-07T16:00"; a date alone for to means to… |
top | number | Keep the N largest carriers/components/buses; the rest become "Other". |
years | array | Only these investment periods / years. |
diagnose_infeasibility
Diagnose why the model is (or was) infeasible. Runs structural checks against the live model state — bus capacity gaps, hourly supply/demand mismatch, disconnected components, time-axis misalignment, zero-availability renewables — and returns ranked findings with suggested fixes and view anchors. ALWAYS call this immediately after any solve result with status='infeasible'. Also useful pre-solve to catch show-stoppers cheaply. Solver-agnostic.
| Parameter | Type | Description |
|---|---|---|
max_findings | integer | Cap on returned findings (default 10). |
scenario_id | string | Which scenario to read: a named scenario by its id (the uuid exactly as it was shown to you) or its name, or the string "base" for the Base Scenario (the as-built network — it has NO id of its own,… |
get_component_timeseries
A summary of one timeseries (length, min/max/mean, p05/p50/p95, zeros, first and last values): demand (p_set), output (p), capacity factors (p_max_pu), prices, state of charge. full: true adds up to max_points raw values.
| Parameter | Type | Description |
|---|---|---|
attribute_name * | string | |
component_name * | string | |
full | boolean | |
max_points | integer | |
scenario_id | string | Optional scenario id (the uuid exactly as it was shown to you) or name, or "base" for the base network. If omitted, returns the timeseries for the currently-active scenario. |
set_series
Fill a whole timeseries on the model's time axis without sending its values. One source: from_file {path, column, sheet} (a project file; by its time column, else one row per period; time_zone "Europe/London" when its times are local clock time, the model's being UTC; stamps: "end" when each time ends its hour; day_first for 06/01 as 6 January; fill: "hold" over gaps or a coarser file; typical_year: true for a 365-day year from 1 January, used for every model year), copy_from {component, attribute, scenario, factor} (another component's series, times factor), constant, per_year {"2030": v} (ho…
| Parameter | Type | Description |
|---|---|---|
attribute * | string | e.g. p_set, p_max_pu |
components * | array | |
scenario * | string | Required: where the change goes. A what-if scenario by name or id (create_scenarios makes one), or "base" for the model itself, only when the user asked to change the model. |
constant | number | |
copy_from | object | |
daily | array | |
from_file | object | |
per_year | object | |
preview | boolean | |
scale_to | object |
fix_build
Fix a solved scenario's build: makes scenario name as a copy of from, with every extendable component set to the capacity that solve chose and no longer extendable, so running it is dispatch only. It does not run it.
| Parameter | Type | Description |
|---|---|---|
from * | string | A solved scenario, or "base". |
name * | string |
write_chart
Save a chart as code into the project's Analytics, creating or replacing by name; the app redraws it wherever it is shown, after every solve. set_dashboard puts it on a dashboard; gallery charts need no code. Name the chart by its data with `chart` (a get_results query and how to draw it), e.g. capacity by year, stacked by carrier: {query: {metric: "capacity", by: ["year", "carrier"]}, type: "bar", x: "year", color: "carrier"}. Write `source` only for what a query cannot show; call with neither for the code contract.
| Parameter | Type | Description |
|---|---|---|
chart | object | A chart named by its data: query = get_results arguments; x and color = dimensions in query.by, or "scenario" to compare scenarios in one panel. x "time" with color "year" overlays the years on a time… |
name | string | Chart name, unique in the project. |
save_anyway | boolean | Save even though the check fails: only when it fails because the model has no results yet. |
source | string | The whole module: `export const reads` and the default chart function. |
strips | array | With only name: set a saved chart's strips ([] clears). |
list_charts
The open model's charts and dashboards, by name, with the charts failing to draw on screen. cards: true adds each dashboard’s charts in order, each with the models and scenarios it draws. name reads one: a chart's source, or a dashboard's charts, what each draws, and how each draws now.
| Parameter | Type | Description |
|---|---|---|
cards | boolean | |
name | string |
rename_chart
Rename a chart; every dashboard and deck drawing it follows. Names are unique in the project.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
to * | string | The new name. |
delete_chart
Remove a chart, or with dashboard: true the dashboard of that name (its charts stay in the project), or with deck: true the deck of that name. A chart on a dashboard is refused and the reply names the dashboards. Ask before removing one you did not make in this session.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
dashboard | boolean | |
deck | boolean |
set_dashboard
Create or replace a project dashboard: charts and tables on a grid. Charts draw `models` ({ chart, models } for one chart): one or more models by name, each with scenarios ("base", "open" = open in the app, or names; default "open"), side by side or overlaid; with several models a series is named "Model: Scenario". Without models: the open model for `scenarios` (none follows the open one); name solved ones, not asking. Charts come from write_chart / list_charts by name, or the gallery by id, each saved into the project first. A card can instead be { block: "<openui-lang>" }: headline figures,…
| Parameter | Type | Description |
|---|---|---|
name * | string | Dashboard name. |
charts | array | In order, each a chart name (a string), { chart, models }, or { block: "<openui-lang>" }; laid out two to a row, a block across the row. |
compare | string | How several scenarios are drawn (default side by side). |
folder | string | The Analytics folder to put it in, e.g. "Results" or "Results/2030"; made if missing. Omit to leave it where it is. |
gallery | array | Built-in charts to add after the named ones. |
models | array | |
scenarios | array | Scenario names or ids, "base"/null for the base network. Omit to follow the app’s open scenario. |
size | string | Every card’s size: smallest (four a row), small (three), medium (two, the default), large (full width). |
rename_dashboard
Rename a dashboard, keeping its cards, settings, open tabs and comments. To move one into a folder, set_dashboard with name and folder only.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
to * | string | The new name. |
set_deck
Create or replace a project deck of slides: for a briefing, findings or a presentation, where dashboards are for exploring. Each slide is a layout and its slots, text as Markdown (**bold**, lists, pipe tables, or a ```openui block of headline figures or a table, as read_skill make-visuals says, checked before it saves) and charts by name from write_chart / list_charts. Layouts and their slots: title (title, subtitle); section (label, title); text (title, body); columns (title, body, body2, body3); chart (title, chart); chartText (title, chart, body); textChart (title, body, chart); twoCharts (…
| Parameter | Type | Description |
|---|---|---|
name * | string | Deck name. |
dark | boolean | Every slide in dark colours. |
folder | string | The Analytics folder to put it in, e.g. "Results" or "Results/2030"; made if missing. Omit to leave it where it is. |
models | array | |
scenarios | array | Scenario names or ids of the open model, "base"/null for the base network. Omit to follow the app’s open scenario. |
slides | array | |
theme | string | The look of every slide (default paper). |
set_values
Change input values in the scenario scenario_id names (a what-if keeps the base unchanged). Each change picks components (component, components, or component_type and/or carrier) and an attribute, then: a value to set; op multiply|add|clip_min|clip_max with amount to rescale a time series (year/month/hour filters); or op reset to drop the override. bus, built_from and built_to also pick. op decline: value × (1−rate)^(build_year − base_year), held at stop_year; op share_of: amount × the component's own `of` value; op retire with year (attribute lifetime): gone from that investment year on…
| Parameter | Type | Description |
|---|---|---|
scenario_id * | string | Required: where the change goes. A what-if scenario by name or id (create_scenarios makes one), or "base" for the model itself, only when the user asked to change the model. |
changes | array | |
from_file | object | |
source | object | The project file the values came from. |
create_scenarios
Make what-if scenarios: scenarios, each with a name and optional overrides (component, attribute, value), or sweep, one scenario per value of an attribute across components. from copies another scenario's changes first. Returns their ids; base is "base". A name "set/member" groups scenarios into an ensemble.
| Parameter | Type | Description |
|---|---|---|
scenarios | array | |
sweep | object | e.g. {attribute: "marginal_cost", values: [40, 60], carrier: "gas"} |
edit_scenario
Rename a scenario or change its description; delete: true deletes it with its overrides and results (ask first unless the user asked).
| Parameter | Type | Description |
|---|---|---|
scenario * | string | Its name or id. |
delete | boolean | |
description | string | |
new_name | string |
history
What changed and who changed it. of "project" (default): files, documents and model edits, newest first (model or path narrows it). of "versions": the project's saved versions (each a point in time of the whole project). of "changes": what a version changed, counted per table.
| Parameter | Type | Description |
|---|---|---|
limit | integer | |
model | string | |
of | string | |
path | string | |
project | string | |
version | string |
app_state
Where you are: the model file this server works on (writable or not), and whether a Convexity app is running with the project, model and scenario it has open, and this server's version. With no model yet, this session starts working on the one the app shows. Cheap; call it first.
| Parameter | Type | Description |
|---|---|---|
sync_detail | boolean |
use_app
Drive another Convexity client from here on: "installed" for the installed desktop app, "web" for the connected web tab, "configured" for the desktop app this server was set up with (the default, which falls back to a web tab only while no desktop app runs), or the folder of a dev instance (its user-data folder, holding mcp-bridge.json). Without instance it lists the clients to pick from.
| Parameter | Type | Description |
|---|---|---|
instance | string |
screenshot
A picture of the Convexity desktop window as it is now, to check what the user sees: a map that draws, a dashboard with data, a model still loading. page, tab or address moves there first, as show_in_app and show_address do. full_page takes the whole page, a screenful per picture. Says which cards and slide slots overflow their box.
| Parameter | Type | Description |
|---|---|---|
address | string | A [[...]] token, as show_address takes. |
full_page | boolean | Scroll the page top to bottom, up to 8 pictures. |
page | string | A page, as show_in_app takes. |
tab | string | A tab of the Model page. |
show_slide
A picture of one slide of a deck in the open project, drawn as the app draws it, charts included: to see what the user sees (text that overflows, a chart left empty) after set_deck. Says which slots overflow their box. Needs the running app.
| Parameter | Type | Description |
|---|---|---|
deck * | string | Deck name. |
slide * | integer | 1 is the first. |
export_deck
Save a deck as PowerPoint, as the app's Export does: a project deck by name, or an analysis run's deck (run, and deck when it has several). Says per slide which charts, pictures and blocks made it in and which came out empty.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path of the .pptx to write on this computer. |
deck | string | Deck name. |
run | string | Run id, or "<analysis>/<run name or number>". |
upload_files
Copy a file or a whole folder from this computer into the project's Files, as they are and of any type (PDFs, spreadsheets, images for slides), into the folder `to`. A folder keeps its layout; hidden files are left out. A path already in Files is skipped unless overwrite. Each file up to 64 MB. A model file becomes a model with open_in_app path instead.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path to a file or folder on this computer. |
overwrite | boolean | |
project | string | Project name or id. |
to | string | Folder in Files, e.g. "reports/". Default: the top. |
solve_via_desktop_app
Solve the open .db FILE through the running Convexity desktop app: queues one job per scenario in the app's Job Queue — free, on this computer, results written into the file in place, so the results tools read them once desktop_app_jobs reports it completed. A model that lives in the app (opened with open_in_app) is solved with run_model. Do not edit the model while its solve is running. Returns at once; solves take minutes.
| Parameter | Type | Description |
|---|---|---|
max_parallel_jobs | integer | How many of the queued scenarios may solve at once. |
scenario_ids | array | Scenario ids to solve (null = base case). Omit to solve the active scenario. |
solver_name | string | Solver engine installed locally; 'highs' is always available, 'mosek' only with a local licence. |
timeout_seconds | integer | With wait: give up waiting after this long (default 900). |
wait | boolean | Block until the jobs finish (progress is reported), then return their outcome. Default false: return as soon as they are queued. |
desktop_app_jobs
Jobs in the running Convexity desktop app's queue (solves, imports, exports), newest first, or one job by id.
| Parameter | Type | Description |
|---|---|---|
job_id | string | From solve_via_desktop_app. |
desktop_app_job_logs
The tail of a desktop-app job's worker log (solver output) — use it to explain a failed local solve.
| Parameter | Type | Description |
|---|---|---|
job_id * | string | |
lines | integer |
account_status
The signed-in Convexity account: which cloud features the organisation has enabled (cloud solve, solvers, data APIs, MCP access) and which Modelverse models it may open. Call it before promising a cloud feature, or to explain a refusal.
list_analyses
The open project's Analyses: name, path, description, inputs (type, default, unit, range or choices) and how many runs each has. With analysis, that one with its docstring (steps, outputs, notes).
| Parameter | Type | Description |
|---|---|---|
analysis | string | Name or path. |
run_analysis
Run an Analysis as its New Run page does. Local (this computer, free) by default; a cloud run is paid and needs the user's go-ahead, then confirm_cloud. Inputs by parameter name; omitted ones take their defaults. Returns the run id; with wait, blocks until it ends and returns its headline outputs.
| Parameter | Type | Description |
|---|---|---|
analysis * | string | Name or path. |
confirm_cloud | boolean | Required true for a cloud run: the user agreed to pay. |
description | string | |
inputs | object | Keyed by main()'s parameter names. |
model | string | Name or id. Default: the analysis's default model, else the open one. |
name | string | The run name. |
solver | string | Default: the Solve step's (MOSEK when the plan has it). |
timeout_seconds | integer | |
wait | boolean | Block until the run ends. |
where | string |
analysis_runs
Analysis runs, newest first: one analysis's or the project's, with id, number, name, status, where, when and error. With run_id (an id, or "<analysis>/<run name or number>"), that run: its inputs, its outputs and its dashboards' cards (id and title, for show_address). A failed run gives its error; runs({run_id, logs: true}) has its log.
| Parameter | Type | Description |
|---|---|---|
analysis | string | Name or path. |
limit | integer | |
run_id | string |
analysis_result
One analysis run's status and, once completed, its outputs: numbers with units, tables (first 50 rows), text and the files it wrote.
| Parameter | Type | Description |
|---|---|---|
run_id * | string |
cancel_analysis_run
Stop an analysis run that is still going. A local run stops only from the computer running it.
| Parameter | Type | Description |
|---|---|---|
run_id * | string |
get_open_model
Report which model .db file this server is currently operating on, and whether it is writable or read-only (and why). Call this first when the user names a file, to check it matches.
open_model
Work on a Convexity model FILE: absolute path to a .db on disk. All subsequent tools operate on it, and edits are written in place — suggest the user works on a copy of any model they care about. A model that lives in the Convexity app is opened with open_in_app instead. Resets the active scenario to the base case. A file older than schema 4.0 is not opened in place: pass upgrade_copy: true to write a converted copy beside it and open that.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path to a model .db. |
upgrade_copy | boolean | For a pre-4.0 file: write <name>-4.1.db beside it (the original is not touched) and open the copy. |
use_scenario
Set the active scenario for all subsequent tool calls: a scenario name or id from list_scenarios, or "base" (or null) for the base case.
| Parameter | Type | Description |
|---|---|---|
scenario | string | null | Scenario name or id, or "base" for the base case. Also accepted as scenario_id. |