@mapled/mcp 0.21.2 → 0.21.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/tools.js +9 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -67,7 +67,7 @@ A rename or a conversion Mapled wouldn't take is refused at once with the reason
|
|
|
67
67
|
| `create_collection` | Add a collection or single |
|
|
68
68
|
| `add_field` | Add a field (short_text, long_text, rich_text, slug, image, number, boolean, date, datetime, relation, enum, url, email, group, file, color, json — an object or list up to 32 KB, location — { lat, lng }, computed, components). Optional `validation` ({min, max, pattern}) and `defaultValue`; `relation` ({target, cardinality: one \| many, onDelete: restrict \| nullify}) is required for relation fields — values are record ids of the target collection, kept in the order given; `onDelete` says what a delete of a linked record does (restrict: it can't be deleted while linked, nullify: the links are cleared — the default is restrict for required fields and nullify otherwise); `options` (1–50 labels) is required for enum fields; `sensitive: true` keeps a field out of lists, history and delivery (a group's sub-fields take it too); `group` ({fields, repeatable, maxItems}) shapes a group field — its values are objects (or arrays of them) keyed by the sub-field keys; `components` ({allowed, min, max}) makes a components field — an ordered list of blocks of the component types named in `allowed` (their keys, from `add_component_type`); values are lists of `{ _type, _key, …sub-fields }`, `_key` given by Mapled and kept when sent back; `computed` ({expression}) makes a computed field — a formula Mapled evaluates whenever a record is read or published, over the record's fields and up to two links through relations (`author.company.name`, `sum(items.product.price)`) or back along one and one link on (`count(@posts.author)`, `sum(@order-items.order.product.price)`), at most one list per path, never a sensitive field or relation; `today()` and `now()` are the moment the value was computed — baked at publish and recomputed once a day for the current release; the site reads the value like any field of its result type. |
|
|
69
69
|
| `add_component_type` | Add a component type — a reusable block (hero, text, gallery…) for `components` fields: a name and the sub-fields an item holds (the types a group's sub-fields take, none sensitive, no relation or components inside); its key is what an item names in `_type`; `types generate` writes one TypeScript type per component and a components field as a union of them |
|
|
70
|
-
| `list_templates` / `create_project_from_template` | Project templates — Mapled's curated starting points (landing, blog, docs). The list gives each one's slug, name, description, starter-site repository and what it creates; creating
|
|
70
|
+
| `list_templates` / `create_project_from_template` | Project templates — Mapled's curated starting points (landing, blog, docs). The list gives each one's slug, name, description, starter-site repository and what it creates; creating **asks** for a new project for the person who connected the client (theirs to own, on one of their plan's slots): nothing is created until that person — and only they see the request — confirms it in Mapled by typing the project's name. The tool answers the request with a `reviewUrl`; `get_confirmation` says when it is applied, and its `result` holds the new project with the template's collections, component types and sample records. `region` (`us` by default, or `eu` on a paid plan) says where the project's data is kept; it is chosen at creation and doesn't change. A template never applies to an existing project, and the connection keeps working only in the project it was made for — the result says how to connect a client to the new one. |
|
|
71
71
|
| `add_records` | Insert draft records — a translated field (`localized: true` in `get_schema`) by language, `{ "en": "About us", "ru": "О нас" }`, or as one plain value, the default language's |
|
|
72
72
|
| `list_records` | Read a collection's draft records, newest edit first — `query` searches their content as full text (every word, the last one from its start; best match first), `limit` (1–200) and `cursor` (the previous answer's `nextCursor`) page through them; `total` counts every match; `locale` reads the translated fields in one language (`ru`) or in every one at once (`*`, as `{ "en": …, "ru": … }`) |
|
|
73
73
|
| `create_form` / `list_forms` | Set up public forms with spam protection |
|
package/dist/tools.js
CHANGED
|
@@ -442,7 +442,7 @@ export function createTools(api) {
|
|
|
442
442
|
},
|
|
443
443
|
{
|
|
444
444
|
name: "get_confirmation",
|
|
445
|
-
description: "Check a request that waits for a person (a destructive change, a rename, a conversion): status is pending (waiting for the " +
|
|
445
|
+
description: "Check a request that waits for a person (a destructive change, a rename, a conversion, a new project from a template): status is pending (waiting for the " +
|
|
446
446
|
"person), applied (done — result says what changed), denied, expired (after an hour; request again if still needed) or failed.",
|
|
447
447
|
schema: { confirmationId: z.string().uuid() },
|
|
448
448
|
handler: async (args) => api.request("GET", `/v1/agent/confirmations/${encodeURIComponent(args.confirmationId)}`),
|
|
@@ -674,17 +674,20 @@ export function createTools(api) {
|
|
|
674
674
|
name: "list_templates",
|
|
675
675
|
description: "List Mapled's project templates — curated starting points for a new project (a landing page, a blog, documentation): for each its slug, name, description, " +
|
|
676
676
|
"the repository of its starter site (`repoUrl`, or null), the collections it creates, and how many component types and sample records come with it. " +
|
|
677
|
-
"A template only ever starts a new project — create_project_from_template; nothing applies one to the project this connection works in.",
|
|
677
|
+
"A template only ever starts a new project — create_project_from_template, which asks the person who connected this client to confirm it in Mapled; nothing applies one to the project this connection works in.",
|
|
678
678
|
schema: {},
|
|
679
679
|
handler: async () => api.request("GET", "/v1/agent/templates"),
|
|
680
680
|
},
|
|
681
681
|
{
|
|
682
682
|
name: "create_project_from_template",
|
|
683
|
-
description: "
|
|
684
|
-
"so call it only when the person asked for a new project.
|
|
685
|
-
"
|
|
683
|
+
description: "Ask for a new Mapled project from a template (list_templates gives the slugs) for the person who connected this client: they would own it, and it takes one of their plan's project slots — " +
|
|
684
|
+
"so call it only when the person asked for a new project. Nothing is created until that person confirms it on a trusted Mapled screen by typing the project's name — only they see the request. " +
|
|
685
|
+
"Returns the request with a reviewUrl — send it to the user — then poll get_confirmation until the status is applied, denied, expired or failed. " +
|
|
686
|
+
"Once applied, the project comes with the template's collections, component types and sample records, all at once or not at all, and the request's `result` holds it: " +
|
|
687
|
+
"`result.project`, `result.created`, `result.template.repoUrl` (its starter site) and `result.next`. " +
|
|
688
|
+
"This connection still works only in the project it was made for: `result.next` says how the person connects a client to the new one. " +
|
|
686
689
|
"`region` is where the project's data is kept — `us` (when left out) or `eu`; it is chosen here and can't be changed later, and `eu` is for paid plans: pass it only when the person asked for it. " +
|
|
687
|
-
"Refused when the slug is taken, the person has no slot left, or the region isn't open to their plan — tell the person; don't try again under another name or region.",
|
|
690
|
+
"Refused at once when the slug is taken, the person has no slot left, or the region isn't open to their plan — tell the person; don't try again under another name or region.",
|
|
688
691
|
schema: {
|
|
689
692
|
template: z.string().min(1).max(60).describe("A template's slug, as list_templates gives it."),
|
|
690
693
|
name: z.string().min(1).max(120).describe("The project's name, as the person will see it."),
|