JillionDB

ドキュメント

エージェントと開発者向け

技術リファレンス:MCP エンドポイント、ツール、提案の形式。

エンドポイント

ツール

list_projects
Lists the JillionDB projects this key can see, with their database engine and table count.
get_schema
Returns the current schema of a project as SQL for its database engine (default) or as JillionDB JSON.
list_issues
Lists design problems in the current schema: missing keys, unindexed relationships, type mismatches and engine limits.
propose_change
Proposes a schema change for the user to review in JillionDB.
get_proposal
Returns a proposal’s status.
list_proposals
Lists recent proposals for a project, newest first.

変更を提案する

operations か sql のどちらか一方を、確認する人が最初に読む一文の summary と一緒に送ります。operations がおすすめです。何が変わるかが明確なので、名前変更は名前変更のまま扱われます。sql は完成形のスキーマ全体で、差分は JillionDB が計算します。

{
  "project_id": "…",
  "summary": "Add a timezone to users so reminders go out at local time",
  "operations": [
    { "op": "add_column", "table": "users",
      "column": { "name": "timezone", "type": "varchar(64)", "nullable": false, "default": "UTC" } }
  ]
}

操作

Each operation is an object with "op" and the fields below. Names are table and column names as they appear in get_schema.
- create_table: table, columns [{name, type, nullable?, default?, unique?, primary_key?, comment?, references?}], primary_key? [names], comment?
- drop_table: table
- rename_table: table, to
- add_column: table, column {name, type, nullable?, default?, unique?, comment?, references?}
- drop_column: table, column
- rename_column: table, column, to
- alter_column: table, column, type?, nullable?, default?, unique?, comment?
- add_index: table, columns [names], unique?, name?
- drop_index: table, name or columns
- add_foreign_key: table, columns [names], references {table, columns? (defaults to its primary key), on_delete?}
- drop_foreign_key: table, columns or name
- set_primary_key: table, columns
- add_check: table, expression, name?
- drop_check: table, name or expression
- set_comment: table, column?, comment
Types: uuid, text, varchar(n), char(n), smallint, integer, bigint, serial, bigserial, decimal(p,s), float, double, boolean, date, time, timestamp, timestamptz, json, binary, enum('a','b').
Defaults: a value (string, number, true/false), "now", "uuid", "autoincrement", {"value": ...} for literal text that looks like a keyword, or {"sql": "..."} for a raw expression.
references: {table, column?, on_delete?: cascade | restrict | set null | set default | no action}.

承認後

get_proposal はプロジェクトのデータベース用の migration_up と migration_down を返します。up の SQL はそのままプロジェクトのマイグレーションに書き、マイグレーションツールが対応していれば down の SQL をロールバックにします。確認者が編集した場合は edited_by_reviewer が true になります。