SvGrid

v3.0.1
com.svgrid/svgrid Checked 4 hours ago Published 2 months ago

Checks AI-written SvGrid code against the real API, plus version-pinned Svelte 5 grid docs.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

svgrid_get Read a doc or demo

Fetch one thing in full by reference: a doc slug ("help/columns/column-definitions"), a demo id ("11-stock-market"), or "api" for the curated API reference. Use svgrid_search first to find the reference.

ParameterTypeDescription
ref *stringA doc slug, a demo id, or "api". The kind is inferred; pass `kind` to force it.
detailstring"full" (default) returns the whole thing; "concise" truncates long content.
kindstringOverride the inferred kind. Default "auto".

svgrid_check_code Check and fix SvGrid code

Verify SvGrid code BEFORE handing it to the user. Checks the source against the real exported surface for this version - props, column options, api methods, imports - and compiles it. Reports unknown props, wrong imports and compile errors with the line to fix, AND returns a corrected copy of the file (`fixed`) whenever the correction is exact, with `applied` listing every edit. Nothing else in this server prevents a confidently wrong answer; call it on every component you write, then use `fixed` rather than re-deriving the edits.

ParameterTypeDescription
source *stringThe file contents to check.
filenamestringOptional filename, used in messages, e.g. "Grid.svelte".

svgrid_preview Preview a grid

Render a REAL, interactive SvGrid in the conversation - sortable, filterable, scrollable - from columns and rows you pass, or from a demo id. Use it to show the user what a grid will look like before they build it, and after svgrid_check_code to demonstrate the result. In clients without UI support it returns a text summary instead, so it is always safe to call.

ParameterTypeDescription
columnsarrayColumn definitions, e.g. [{ "field": "name", "header": "Name", "width": 160 }]. Required unless `demo` is set.
dataarrayRows to display. Required unless `demo` is set. Keep it under a few hundred for a preview.
demostringPreview a shipped demo instead, by id (e.g. "11-stock-market"). Its source is returned as text; find ids with svgrid_search.
filterablebooleanFiltering. Default true.
groupByarrayGroup by these column ids.
pageablebooleanPagination footer.
sortablebooleanSortable headers. Default true.
titlestringCaption shown above the grid.

svgrid_scaffold Scaffold a CRUD screen

SvGrid Studio (commercial): turn a data source into runnable SvelteKit files - the $lib schema module, a +server.ts API route, and a +page.svelte with SvGrid + SvGridEditPanel. Accepts a Drizzle schema, sample JSON rows, or an EntitySchema you already have; infers the schema and generates in one call. Set schemaOnly to stop after inference. Generated bodies carry svgrid:managed markers so regeneration preserves your edits outside them.

ParameterTypeDescription
from *string"drizzle" a schema file, "json" sample rows, or "schema" an EntitySchema.
apiRoutestringAPI route, e.g. "/api/people".
drizzlestringFor from:"drizzle": the schema source.
namestringFor from:"json": the entity name.
routestringPage route, e.g. "/people".
rowsarrayFor from:"json": a non-empty array of sample rows.
schemaobjectFor from:"schema": an EntitySchema.
schemaOnlybooleanReturn the inferred EntitySchema without generating files.