convexity-mcp

v0.12.4
io.github.bayesian-energy/convexity-mcp Checked 1 day ago Published 6 days ago

Build, 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.

ParameterTypeDescription
component_name *stringName 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…

ParameterTypeDescription
againbooleanWith path: import it even when the project has a model of that name.
createobjectA new, empty model called name.
model_idstring
namestringThe model's name as the app shows it. With path: the name for the imported model (default: the file name without its extension).
pathstringAbsolute 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).
projectstringThe 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.

ParameterTypeDescription
name *stringThe new project's name.
examplestringStart 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)".

ParameterTypeDescription
name *stringThe model's name, or its id.
to *stringThe new name.
projectstringThe 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.

ParameterTypeDescription
name *stringThe model's name, or its id.
projectstringThe 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.

ParameterTypeDescription
name *stringWhat the version marks.
projectstringProject 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…

ParameterTypeDescription
version *stringVersion id or name.
projectstringProject 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.

ParameterTypeDescription
query *string
top_kinteger

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.

ParameterTypeDescription
aggregatebooleanfalse: each component too (up to 500).
component_typestringWith aggregate:false, only this type.
includearray

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.

ParameterTypeDescription
param_name *stringParameter to set (e.g. 'discount_rate', 'solver_name', 'unmet_load_active').
param_type *stringThe value type.
param_value *stringThe value, as a string (e.g. "0.05", "highs", "true"). Coerced to param_type by the backend.
scenario_idstringRequired: 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.

ParameterTypeDescription
resetboolean
scenario_idstringRequired: 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.
setobject

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.

ParameterTypeDescription
component_typestringe.g. 'GENERATOR', 'LOAD', 'LINK', 'STORAGE_UNIT', 'BUS' — omit for the index.
group_namestringOnly rules in this group (group names come from the index).
names_onlybooleanWith 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.

ParameterTypeDescription
againststring
changes_forstringA scenario id or name: list what it changes instead.
include_actualbooleanIf true, include the 'Actual' scenario. Default is false.
limitinteger
offsetinteger

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…

ParameterTypeDescription
components *array
scenario *string"base" to build the model, or a what-if scenario.
sourceobjectThe 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.

ParameterTypeDescription
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.

ParameterTypeDescription
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…

ParameterTypeDescription
years *arrayWeather years, e.g. [2018, 2019, 2020].
componentsarrayOnly these generators.
ensemblestringSeveral years: the ensemble's name (default "Weather").
previewbooleanOnly report each year’s average capacity factors.
scenariostringOne 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_modelstring
techstringWhich generators, by carrier. Default both.
wind_modelstring

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.

ParameterTypeDescription
confirm_cloudbooleanRequired true for a cloud run: the user agreed to pay.
representative_daysobjectCapacity 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_idsarrayScenarios to solve, by id or name; "base" or null for the base network. Omit for the open scenario.
timeout_secondsinteger
waitbooleanBlock until the run ends and its results are in.
wherestringDefault: 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).

ParameterTypeDescription
limitinteger
logsboolean
run_idstring

cancel_run

Cancel a run of the open model: a cloud run, or a local run solving on this computer.

ParameterTypeDescription
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.

ParameterTypeDescription
pagestring
tabstringA tab of the Model page (implies page: overview).
tableobjectTables 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…

ParameterTypeDescription
address *stringThe 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.

ParameterTypeDescription
columnsarray
filterobjectcolumn → text, number, list of values, or {min, max}; {} clears
limitinteger
sortobject
typestringDefault: 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.

ParameterTypeDescription
namestringA 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.

ParameterTypeDescription
level *string
inferredboolean

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.

ParameterTypeDescription
deletedboolean
limitnumber
offsetnumber
prefixstring
projectstring

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.

ParameterTypeDescription
idstring
linesstring
pagesstring
pathstring
projectstring
sheetstring

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.

ParameterTypeDescription
query *string
prefixstring
projectstring

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.

ParameterTypeDescription
path *stringe.g. "notes/assumptions.md"
expectedstring
from_resultsobject
overwriteboolean
projectstring
textstring

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.

ParameterTypeDescription
edits *array
path *string
projectstring

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.

ParameterTypeDescription
operations *array
projectstring

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.

ParameterTypeDescription
analysis *stringName or path.
overwriteboolean
runstringA 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.

ParameterTypeDescription
attributestringe.g. "capital_cost".
componentstringComponent name.
filestringSources citing this file path.
limitnumberUnsourced values listed; default 100.
scenariostringScenario name. Absent or "base": the base network, whose source also backs a scenario that keeps the base value.
typestringComponent type, e.g. GENERATOR.
unsourcedboolean

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.

ParameterTypeDescription
accessed_onstringWhen the page was read, YYYY-MM-DD. Default: today.
attributestringe.g. "capital_cost".
busstring
carrierstring
citestringA project file: [[source:<path>|p=<page>|q=<exact words>]], |sheet=…|range=… for a spreadsheet, or just the path for the whole file.
componentstringComponent name.
component_typestring
itemsarrayMany 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…
notestringHow the value follows, e.g. "converted from $/kW".
quotestringThe words on the web page that give the value.
scenariostringScenario name. Absent or "base": the base network, whose source also backs a scenario that keeps the base value.
titlestringThe web page's title.
urlstringA 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.

ParameterTypeDescription
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.

ParameterTypeDescription
componentstringOnly threads on this component, by name.
dashboardstringOnly threads on this dashboard's cards, by name.
filestringOnly threads on this file path.
limitinteger
offsetinteger
statusstringWhich 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.

ParameterTypeDescription
attributestringThe value commented on, e.g. "p_nom".
bodystringWhat to say. Plain text.
busstring
carrierstring
chartstringThe chart drawn on that dashboard, by name.
componentstringComponent name.
component_typestring
dashboardstringA dashboard name; with chart, the card the comment is on.
filestringA project file path.
itemsarrayMany comments in one call, each {body, component, attribute, scenario}, {body, file, spot} or {body, dashboard, chart}.
reply_tostringA comment id: the reply goes in its thread.
scenariostringScenario name; absent or "base" for the base network.
spotobjectWhere 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.

ParameterTypeDescription
id *stringA comment id from list_comments.
resolvedbooleanfalse 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 `…

ParameterTypeDescription
name *stringName of the constraint (e.g. 'Min Wind Generation', 'CO2 Cap')
check_onlyboolean
constraint_codestringThe constraint code in DSL or Python
constraint_languagestringLanguage of the constraint code
descriptionstringOptional description of the constraint
is_activebooleanWhether the constraint is active (default true)
priorityintegerExecution priority (lower = earlier, default 0)
templateobject

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.

ParameterTypeDescription
name *string
activeboolean
constraint_codestring
deleteboolean
scenariostring

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…

ParameterTypeDescription
metric *stringOne metric name from the list.
base_yearinteger
busesarrayOnly these buses (names or ids).
byarrayDimensions to split by. Empty = one total per scenario.
carriersarrayOnly these carriers (display names).
componentsarrayOnly these components (names).
include_zerobooleanKeep zero rows.
layoutstringwide (default): with 2+ dimensions, carriers (or components, buses) become columns. long: one row per value.
ratenumber
scenariosarrayScenario names or ids, "base", or ["solved"] for every solved scenario. Default: the open scenario.
timeobjectWith 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…
topnumberKeep the N largest carriers/components/buses; the rest become "Other".
yearsarrayOnly 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.

ParameterTypeDescription
max_findingsintegerCap on returned findings (default 10).
scenario_idstringWhich 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.

ParameterTypeDescription
attribute_name *string
component_name *string
fullboolean
max_pointsinteger
scenario_idstringOptional 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…

ParameterTypeDescription
attribute *stringe.g. p_set, p_max_pu
components *array
scenario *stringRequired: 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.
constantnumber
copy_fromobject
dailyarray
from_fileobject
per_yearobject
previewboolean
scale_toobject

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.

ParameterTypeDescription
from *stringA 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.

ParameterTypeDescription
chartobjectA 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…
namestringChart name, unique in the project.
save_anywaybooleanSave even though the check fails: only when it fails because the model has no results yet.
sourcestringThe whole module: `export const reads` and the default chart function.
stripsarrayWith 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.

ParameterTypeDescription
cardsboolean
namestring

rename_chart

Rename a chart; every dashboard and deck drawing it follows. Names are unique in the project.

ParameterTypeDescription
name *string
to *stringThe 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.

ParameterTypeDescription
name *string
dashboardboolean
deckboolean

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,…

ParameterTypeDescription
name *stringDashboard name.
chartsarrayIn order, each a chart name (a string), { chart, models }, or { block: "<openui-lang>" }; laid out two to a row, a block across the row.
comparestringHow several scenarios are drawn (default side by side).
folderstringThe Analytics folder to put it in, e.g. "Results" or "Results/2030"; made if missing. Omit to leave it where it is.
galleryarrayBuilt-in charts to add after the named ones.
modelsarray
scenariosarrayScenario names or ids, "base"/null for the base network. Omit to follow the app’s open scenario.
sizestringEvery 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.

ParameterTypeDescription
name *string
to *stringThe 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 (…

ParameterTypeDescription
name *stringDeck name.
darkbooleanEvery slide in dark colours.
folderstringThe Analytics folder to put it in, e.g. "Results" or "Results/2030"; made if missing. Omit to leave it where it is.
modelsarray
scenariosarrayScenario names or ids of the open model, "base"/null for the base network. Omit to follow the app’s open scenario.
slidesarray
themestringThe 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…

ParameterTypeDescription
scenario_id *stringRequired: 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.
changesarray
from_fileobject
sourceobjectThe 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.

ParameterTypeDescription
scenariosarray
sweepobjecte.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).

ParameterTypeDescription
scenario *stringIts name or id.
deleteboolean
descriptionstring
new_namestring

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.

ParameterTypeDescription
limitinteger
modelstring
ofstring
pathstring
projectstring
versionstring

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.

ParameterTypeDescription
sync_detailboolean

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.

ParameterTypeDescription
instancestring

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.

ParameterTypeDescription
addressstringA [[...]] token, as show_address takes.
full_pagebooleanScroll the page top to bottom, up to 8 pictures.
pagestringA page, as show_in_app takes.
tabstringA 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.

ParameterTypeDescription
deck *stringDeck name.
slide *integer1 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.

ParameterTypeDescription
path *stringAbsolute path of the .pptx to write on this computer.
deckstringDeck name.
runstringRun 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.

ParameterTypeDescription
path *stringAbsolute path to a file or folder on this computer.
overwriteboolean
projectstringProject name or id.
tostringFolder 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.

ParameterTypeDescription
max_parallel_jobsintegerHow many of the queued scenarios may solve at once.
scenario_idsarrayScenario ids to solve (null = base case). Omit to solve the active scenario.
solver_namestringSolver engine installed locally; 'highs' is always available, 'mosek' only with a local licence.
timeout_secondsintegerWith wait: give up waiting after this long (default 900).
waitbooleanBlock 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.

ParameterTypeDescription
job_idstringFrom 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.

ParameterTypeDescription
job_id *string
linesinteger

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).

ParameterTypeDescription
analysisstringName 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.

ParameterTypeDescription
analysis *stringName or path.
confirm_cloudbooleanRequired true for a cloud run: the user agreed to pay.
descriptionstring
inputsobjectKeyed by main()'s parameter names.
modelstringName or id. Default: the analysis's default model, else the open one.
namestringThe run name.
solverstringDefault: the Solve step's (MOSEK when the plan has it).
timeout_secondsinteger
waitbooleanBlock until the run ends.
wherestring

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.

ParameterTypeDescription
analysisstringName or path.
limitinteger
run_idstring

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.

ParameterTypeDescription
run_id *string

cancel_analysis_run

Stop an analysis run that is still going. A local run stops only from the computer running it.

ParameterTypeDescription
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.

ParameterTypeDescription
path *stringAbsolute path to a model .db.
upgrade_copybooleanFor 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.

ParameterTypeDescription
scenariostring | nullScenario name or id, or "base" for the base case. Also accepted as scenario_id.