Side effect: saves the app's schema and a summary of how its onboarding works on the project. Use after get app context request, with the schema query's JSON as catalog (or tables you read from code) and the onboarding summary. Works without a connected database, and without a schema. Returns what was stored, summary fields still missing, whether the schema was trimmed to fit, and the next setup step with its setup page link (ask the person to connect the database there), or a completion offer if a database was connected first. Do not send rows, connection strings, email addresses or other per
Показать схему аргументов
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"onboardingSummary"
],
"properties": {
"counts": {
"type": "object",
"properties": {
"signedUp": {
"type": "integer",
"maximum": 1000000000,
"minimum": 0,
"description": "People who signed up in the window."
},
"stuckNow": {
"type": "integer",
"maximum": 1000000000,
"minimum": 0,
"description": "People who look stuck right now (stuckLooksLike)."
},
"windowDays": {
"type": "integer",
"maximum": 365,
"minimum": 1,
"description": "The window the counts cover, in days."
},
"reachedSteps": {
"type": "array",
"items": {
"type": "integer",
"maximum": 1000000000,
"minimum": 0
},
"maxItems": 5,
"description": "How many of the signedUp people did each of firstSteps, in the same order. Dreamlit draws them as a funnel."
}
},
"description": "Optional. Run SELECT count(*) queries yourself and send only the numbers. Never send rows, connection strings, email addresses or other personal data. Counts only."
},
"schema": {
"type": "object",
"required": [
"source",
"via"
],
"properties": {
"via": {
"type": "string",
"maxLength": 40,
"minLength": 1,
"description": "How you got it, e.g. supabase_mcp, psql, prisma, supabase/migrations, drizzle, schema.rb."
},
"enums": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"labels"
],
"properties": {
"name": {
"type": "string",
"maxLength": 128,
"minLength": 1
},
"labels": {
"type": "array",
"items": {
"type": "string",
"maxLength": 128
},
"maxItems": 100
},
"schema": {
"type": "string",
"default": "public",
"maxLength": 128,
"minLength": 1
}
}
},
"maxItems": 500
},
"source": {
"enum": [
"database",
"code"
],
"type": "string",
"description": "database: you ran the schema query against the app's database. code: you read it from migrations or ORM files."
},
"tables": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"columns"
],
"properties": {
"name": {
"type": "string",
"maxLength": 128,
"minLength": 1
},
"schema": {
"type": "string",
"default": "public",
"maxLength": 128,
"minLength": 1
},
"columns": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"name": {
"type": "string",
"maxLength": 128,
"minLength": 1
},
"type": {
"type": "string",
"maxLength": 128,
"minLength": 1
},
"nullable": {
"type": "boolean",
"default": true
},
"isPrimaryKey": {
"type": "boolean",
"default": false
}
}
},
"maxItems": 500
}
}
},
"maxItems": 1000,
"description": "Tables you read from code, with column names and Postgres types. Use this when you can't query the database."
},
"catalog": {
"type": "object",
"required": [
"columns"
],
"properties": {
"enums": {
"type": "array",
"items": {
"type": "object",
"required": [
"enum_schema",
"enum_name",
"enum_labels"
],
"properties": {
"enum_name": {
"type": "string",
"maxLength": 128,
"minLength": 1
},
"enum_labels": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string",
"maxLength": 128
},
"maxItems": 100
},
{
"type": "string",
"maxLength": 4000
}
]
},
"enum_schema": {
"type": "string",
"maxLength": 128,
"minLength": 1
}
}
},
"default": [],
"maxItems": 1000
},
"columns": {
"type": "array",
"items": {
"type": "object",
"required": [
"table_schema",
"table_name",
"column_name",
"data_type",
"is_nullable",
"is_primary_key"
],
"properties": {
"data_type": {
"type": "string",
"maxLength": 200,
"minLength": 1
},
"table_name": {
"type": "string",
"maxLength": 128,
"minLength": 1
},
"column_name": {
"type": "string",
"maxLength": 128,
"minLength": 1
},
"is_nullable": {
"anyOf": [
{
"type": "boolean"
},
{
"enum": [
"t",
"f",
"true",
"false",
"YES",
"NO"
],
"type": "string"
}
]
},
"table_schema": {
"type": "string",
"maxLength": 128,
"minLength": 1
},
"is_primary_key": {
"anyOf": [
{
"type": "boolean"
},
{
"enum": [
"t",
"f",
"true",
"false",
"YES",
"NO"
],
"type": "string"
}
]
},
"ordinal_position": {
"anyOf": [
{
"type": "number"
},
{
"type": "string",
"maxLength": 10
}
]
}
}
},
"maxItems": 20000
},
"foreignKeys": {
"type": "array",
"items": {
"type": "object",
"required": [
"table_schema",
"table_name",
"column_names",
"foreign_table_schema",
"foreign_table_name",
"foreign_column_names"
],
"properties": {
"table_name": {
"type": "string",
"maxLength": 128,
"minLength": 1
},
"column_names": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string",
"maxLength": 128
},
"maxItems": 100
},
{
"type": "string",
"maxLength": 4000
}
]
},
"table_schema": {
"type": "string",
"maxLength": 128,
"minLength": 1
},
"foreign_table_name": {
"type": "string",
"maxLength": 128,
"minLength": 1
},
"foreign_column_names": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string",
"maxLength": 128
},
"maxItems": 100
},
{
"type": "string",
"maxLength": 4000
}
]
},
"foreign_table_schema": {
"type": "string",
"maxLength": 128,
"minLength": 1
}
}
},
"default": [],
"maxItems": 5000
}
},
"description": "The JSON object get_app_context_request's schemaQuery returns, as is. Use this when you can query the database."
},
"foreignKeys": {
"type": "array",
"items": {
"type": "object",
"required": [
"table",
"columns",
"references",
"referencedColumns"
],
"properties": {
"table": {
"type": "string",
"maxLength": 260,
"minLength": 1,
"description": "schema.table, e.g. public.dogs"
},
"columns": {
"type": "array",
"items": {
"type": "string",
"maxLength": 128,
"minLength": 1
},
"maxItems": 16,
"minItems": 1
},
"references": {
"type": "string",
"maxLength": 260,
"minLength": 1,
"description": "schema.table, e.g. public.profiles"
},
"referencedColumns": {
"type": "array",
"items": {
"type": "string",
"maxLength": 128,
"minLength": 1
},
"maxItems": 16,
"minItems": 1
}
}
},
"maxItems": 2000
}
},
"description": "The app's schema. Column names and types only; never rows. Leave it out if you couldn't find one."
},
"projectId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "Optional project id. Omit it when the workspace has one project."
},
"onboardingSummary": {
"type": "object",
"properties": {
"tone": {
"type": "string",
"maxLength": 300,
"minLength": 1,
"description": "How the app talks to users, e.g. 'friendly and short' or 'formal'. Copy it from the landing page or onboarding screens."
},
"evidence": {
"type": "array",
"items": {
"type": "string",
"maxLength": 300,
"minLength": 1
},
"maxItems": 5,
"description": "Up to 5 short notes on where you found this, e.g. 'supabase/migrations/0002_dogs.sql'."
},
"userTable": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_$]*(\\.[A-Za-z_][A-Za-z0-9_$]*)?$",
"maxLength": 127,
"description": "The table with one row per user, e.g. profiles or public.profiles."
},
"firstSteps": {
"type": "array",
"items": {
"type": "string",
"maxLength": 300,
"minLength": 1
},
"maxItems": 5,
"description": "Up to 5 things a new user should do first, in order, e.g. 'add a dog'."
},
"emailColumn": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_$]*$",
"maxLength": 63,
"description": "The column in userTable with the user's email address, e.g. email."
},
"productName": {
"type": "string",
"maxLength": 300,
"minLength": 1,
"description": "The product's name, as users see it."
},
"followUpIdea": {
"type": "string",
"maxLength": 300,
"minLength": 1,
"description": "One follow-up email idea for people still stuck a day after the first nudge, specific to this product: a different reason to take that step, in a few words, e.g. 'show 3 popular walks nearby'."
},
"signupCreates": {
"type": "string",
"maxLength": 300,
"minLength": 1,
"description": "What signing up creates, e.g. 'a row in profiles with created_at'."
},
"stuckLooksLike": {
"type": "string",
"maxLength": 300,
"minLength": 1,
"description": "What a stuck user looks like, e.g. 'signed up 2+ days ago and has no dogs row'."
},
"trialOrPricing": {
"type": "string",
"maxLength": 300,
"minLength": 1,
"description": "Trial and pricing in a sentence, e.g. '14-day trial, then $9/month'. Leave it out if there is none."
},
"activationAction": {
"type": "object",
"required": [
"description"
],
"properties": {
"table": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_$]*(\\.[A-Za-z_][A-Za-z0-9_$]*)?$",
"maxLength": 127
},
"condition": {
"type": "string",
"maxLength": 300,
"minLength": 1
},
"description": {
"type": "string",
"maxLength": 300,
"minLength": 1
}
},
"description": "The one action that shows a user got value. description is a past-tense phrase ('added a dog'); table and condition say how to see it in the data ('dogs', 'a dogs row with owner_id = profiles.id')."
}
},
"description": "How the app's onboarding works, from the repo and schema. Never send rows, connection strings, email addresses or other personal data. Counts only."
}
}
}