DataLion
Use this skill for DataLion project, project-settings, data-import, codebook, chart-table, report, report-tab, dashboard, and export workflows.
In DataLion, "tab" and "dashboard" are used interchangeably for the report subpages managed under a report.
Default Strategy
- Verify the
datalionMCP server is enabled and inspect whichdatalion__*tools are actually available in the current session. - Use MCP first for supported actions.
- Do not invent Datalion MCP tools. If a matching tool is missing, switch to a REST or browser/UI path from references/setup-and-capabilities.md.
- Read first, write second. Restate the exact target object and proposed mutation before calling a write path.
Setup
- Run HybridClaw in host sandbox mode for this local Node-based MCP server.
- Install the bridge dependencies before first use:
npm --prefix <path-to-your-datalion-repo>/mcp install - Keep
DATALION_API_TOKENinside MCP server configenv, never in tracked files or chat. - Use the MCP server name
datalionso tools appear asdatalion__.... - For
hybridclaw gateway mcp add ..., pass the JSON config as one quoted shell argument. Inzsh, unquoted{...}and[...]will be expanded before HybridClaw sees them. - See references/setup-and-capabilities.md for ready-to-paste CLI and TUI examples, dependency notes, and ability requirements.
Working Rules
- Always state whether you are using MCP, REST API, or browser/UI automation.
- Resolve the exact project, report, dashboard, export, or chart before mutating anything.
- The current bridge directly supports project listing, project reads, project creation, project settings updates, data source listing, CSV upload, full Excel/CSV import, report list/create and tab CRUD, chart-table reads, and codebook list, download, generation, deletion, and upload.
- The bridge also exposes 4 browser URL helpers for project/report/dashboard opening and widget insertion.
- The current bridge tool surface has 22 tools total: 18 backend MCP actions and 4 browser URL helpers.
- Prefer
datalion__list_projectsanddatalion__read_projectbefore writes when the exact target project is not already pinned down. - Treat
datalion__upload_dataas a data-import tool, not a generic project-update tool. - Treat
datalion__edit_projectas adefsettingsmerge tool. It updates only the keys you pass and keeps the existing settings for all other keys. - Use
datalion__list_data_sourcesto inspect what is already loaded into a project before uploading or troubleshooting data. - Prefer
datalion__import_excel_datawhen the source is an.xlsxworkbook or when you want Datalion's full import pipeline, including optional codebook generation during import. - Use
datalion__list_codebookwhen the user needs a question-level inventory; usedatalion__download_codebookfor the tree structure. - For workbook imports, prefer an absolute
localPathso the bridge can read the file directly. - For uploads, confirm filename, header and delimiter assumptions, data source name if relevant, and whether existing rows should be truncated.
- For
import_excel_data, confirmprojectId, file path or base64 file content, filename if you are not usinglocalPath, whether you want the default main data source (useDefaultDataSource=true) or a named data source, and whetherreplaceData,runCalculations,convertComma,skipLines,comment, andcreateCodebookshould be enabled. - For project settings edits, confirm the target
projectIdand the exactdefsettingskeys and values before calling. - For chart-table reads, confirm
projectId,chartId, and any filter string before calling. - For codebook uploads, confirm
projectId, CSV filename, import mode, and whether any explicit column mapping is needed. The current backend expectscolumnMappingas an array aligned to the CSV header order. - For reports, prefer direct MCP coverage first.
- For dashboard and export tasks without direct MCP coverage, inspect the local Datalion repo and its OpenAPI or route definitions before choosing a fallback path.
- Keep tokens, auth headers, and exported files out of logs unless the user explicitly asks for them.
Current MCP Coverage
The current datalion bridge exposes these direct tools:
datalion__list_projectsdatalion__read_projectdatalion__create_projectdatalion__edit_projectdatalion__list_data_sourcesdatalion__upload_datadatalion__import_excel_datadatalion__list_reportsdatalion__create_reportdatalion__create_report_tabdatalion__edit_report_tabdatalion__delete_report_tabdatalion__open_project_browserdatalion__open_report_browserdatalion__open_dashboard_browserdatalion__open_add_widget_browserdatalion__get_chart_tabledatalion__list_codebookdatalion__download_codebookdatalion__generate_codebookdatalion__delete_codebookdatalion__upload_codebook
That means:
- project discovery and project detail reads are supported directly
- project creation is supported directly
- project settings updates through
defsettingsmerges are supported directly - project data sources can be listed directly
- CSV-style data import into an existing project is supported directly
- workbook and full-pipeline Excel/CSV import are supported directly
- the full-pipeline import path uses DataLion's datasource service rather than the raw CSV upload path, so it handles type detection, replace/append mode, optional codebook generation, and optional calculations
- report listing and report creation are supported directly
- chart tables can be read directly
- codebooks can be listed, downloaded, generated, deleted, and uploaded directly
- report editing beyond report-tab CRUD, dashboard editing, and export generation require fallback API or UI paths until the bridge grows more tools
Common Workflows
For explicit TUI testing, prefer /skill datalion ....
/skill datalion create a project named "MCP Smoke Test"- plain natural-language prompts that mention DataLion also work
/datalion ...may still be routed as a normal message, but it is not a built-in slash-menu command, so do not use slash-menu visibility as the test for whether the skill is installed
Create a Project
- Confirm the project name and any optional
identcodeordefsettings. - Call
datalion__create_project. - Return the new project ID and recommend the next step, usually data import or report/dashboard setup.
Create a Report
- Confirm the project ID and report name.
- Call
datalion__create_report. - Note that the report is seeded with a first tab and return both the report ID and first tab ID.
Manage Report Tabs
- Call
datalion__create_report_tabto add a tab to an existing report. - Call
datalion__edit_report_tabto rename or update a tab. - Call
datalion__delete_report_tabto remove a tab after confirming the report and tab IDs. - Keep
projectIdaligned with the report or tab/dashboard you are mutating.
Open In Browser
- Use
datalion__open_project_browserfor the project screen. - Use
datalion__open_report_browserfor the report editor or a specific report tab/dashboard. - Use
datalion__open_dashboard_browserfor a specific tab/dashboard view. - Use
datalion__open_add_widget_browserto get the modal URL used to add a question/widget to a tab/dashboard. The actual insertion still happens in the browser UI after the modal is opened.
Find or Read a Project
- Call
datalion__list_projectswhen the user gives a fuzzy project name or identcode. - Call
datalion__read_projectonce you know theprojectId. - Use the returned
defsettings,categoriesCount, anddataSourcesCountto guide the next step.
Edit Project Settings
- Confirm
projectIdand the exactdefsettingskeys to merge. - Call
datalion__edit_project. - Return the updated keys and note that untouched settings stay as they were.
Upload Data
- Confirm the target project ID.
- Call
datalion__list_data_sourcesfirst if you need to inspect existing data sources. - Prefer CSV text input for the current bridge.
- Call
datalion__upload_data. - Return the job ID and the import assumptions you used.
Import Excel or CSV via Datalion Pipeline
- Confirm
projectIdand the source file path or file content. - Prefer
localPathfor.xlsximports when the file exists on disk. - Use
useDefaultDataSource=truewhen you want the workbook imported into the main project data table and codebook generation to read from that same table. Otherwise confirmdataSourceName. - Confirm whether
createCodebookshould run during import. - Call
datalion__import_excel_data. - Return the data source name, imported row count, and whether codebook generation was requested.
Read a Chart Table
- Confirm
projectId,chartId, and filters. - Call
datalion__get_chart_table. - Summarize the result and surface obvious caveats.
Codebook Workflows
- For question-level inspection, call
datalion__list_codebook. - For tree-structured inspection, call
datalion__download_codebook. - For regenerate-from-data workflows, call
datalion__generate_codebook. - For destructive cleanup, call
datalion__delete_codebookand confirm whetherincludeTextboxesshould betrue. - For CSV import, call
datalion__upload_codebookwith the filename, file content, import mode, and any index-basedcolumnMappingarray that should align with the CSV header order.
Reports
- Call
datalion__list_reportsto inspect existing reports for a project. - Call
datalion__create_reportto create a new report once the target project and report name are confirmed. The new report is seeded with a first tab and the response includes both IDs. - Use the report-tab tools for tab-level create/edit/delete work.
- Treat report edits beyond tab CRUD as fallback work until direct MCP coverage exists.
Dashboards and Exports
- Check current
datalion__*tool coverage first. - If no direct tool exists, inspect
openapi.yaml,routes/dashboard.php, androutes/export.phpin the local Datalion checkout or use browser automation against the Datalion UI. - Prefer REST endpoints for API-backed CRUD and browser/UI paths for web-only export flows.
- Be explicit about which path you chose and why.