{
 "groups": [
  {
   "name": "contacts",
   "label": "Contacts",
   "about": "the people the business deals with",
   "description": "The people the business deals with, shared by all the owner's agents. Add and update the ones your work touches on your own judgement: no yes is needed, and every change can be undone. Use add_many for several at once; to fill Contacts from mail, search mail the owner sent (dir sent, bulk false): its counts.people says who they write to most; read their latest messages for names, roles and phones, then save them. Read someone's Context with find before you write to them. The businesses they work at are in companies.",
   "research": false,
   "ownWrites": true,
   "tools": [
    {
     "name": "list",
     "summary": "Compact contacts; company is a name or id",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "label": {
        "type": "string",
        "minLength": 1,
        "maxLength": 40
       },
       "company": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
       },
       "query": {
        "type": "string",
        "maxLength": 200
       },
       "open": {
        "type": "string",
        "enum": [
         "you",
         "them",
         "follow_up"
        ]
       },
       "quietDays": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
       },
       "offset": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
       }
      }
     },
     "returns": "{\n  items: {\n    id: string;\n    name: string;\n    company: string | null;\n    labels: string[];\n    last: ContactLast;\n    open: {\n      id: string;\n      kind: \"you\" | \"them\" | \"follow_up\";\n      text: string;\n      at: string;\n      thread?: string;\n      link?: string;\n      by?: {\n        kind: \"agent\" | \"user\" | \"system\";\n        id: string;\n      };\n    } | null;\n  }[];\n  nextOffset: number | null;\n  total: number;\n}"
    },
    {
     "name": "find",
     "summary": "The contact with that address, their Context, company Context and open items, or null",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "email": {
        "type": "string"
       }
      },
      "required": [
       "email"
      ]
     },
     "returns": "{\n  companies: {\n    context: string | null;\n    id: string;\n    name: string;\n    ticker: string | null;\n    handle: string;\n    role?: string | null;\n    since?: string | null;\n    ended?: string | null;\n    labels?: string[];\n  }[];\n  id: string;\n  organizationId: string;\n  name: string;\n  emails: string[];\n  phone: string | null;\n  jobTitle: string | null;\n  labels: string[];\n  context: string | null;\n  open: {\n    id: string;\n    kind: \"you\" | \"them\" | \"follow_up\";\n    text: string;\n    at: string;\n    thread?: string;\n    link?: string;\n    by?: {\n      kind: \"agent\" | \"user\" | \"system\";\n      id: string;\n    };\n  }[];\n  last: ContactLast;\n  fields: ContactFreeFields;\n  status: \"active\" | \"suggested\" | \"ignored\";\n  projects: ProjectRef[];\n  createdAt: string;\n  updatedAt: string;\n} | null"
    },
    {
     "name": "read",
     "summary": "Fields, Context, open items, newest 20 log entries, companies and projects",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "contactId": {
        "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)$"
       }
      },
      "required": [
       "contactId"
      ]
     },
     "returns": "{\n  log: {\n    id: string;\n    at: string;\n    by: {\n      kind: \"agent\" | \"user\" | \"system\";\n      id: string;\n    };\n    kind: \"removed\" | \"note\" | \"ask\" | \"context\" | \"labels\" | \"created\" | \"sent\" | \"drafted\" | \"triage\" | \"looked\" | \"merged\" | \"restored\";\n    text?: string;\n    before?: string | string[] | null;\n    after?: string | string[] | null;\n    why?: string;\n    subject?: string;\n    to?: string[];\n    thread?: string;\n    link?: string;\n    hold?: number;\n    sentAt?: string;\n    approval?: {\n      kind: \"rule\" | \"allowed\" | \"waiting\" | \"yes\" | \"undone\" | \"declined\";\n      at?: string;\n      rule?: string;\n    };\n  }[];\n  id: string;\n  organizationId: string;\n  name: string;\n  emails: string[];\n  phone: string | null;\n  jobTitle: string | null;\n  labels: string[];\n  context: string | null;\n  open: {\n    id: string;\n    kind: \"you\" | \"them\" | \"follow_up\";\n    text: string;\n    at: string;\n    thread?: string;\n    link?: string;\n    by?: {\n      kind: \"agent\" | \"user\" | \"system\";\n      id: string;\n    };\n  }[];\n  last: ContactLast;\n  fields: ContactFreeFields;\n  status: \"active\" | \"suggested\" | \"ignored\";\n  companies: CompanyRef[];\n  projects: ProjectRef[];\n  createdAt: string;\n  updatedAt: string;\n}"
    },
    {
     "name": "timeline",
     "summary": "Live mail threads and meetings this agent may read",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "contactId": {
        "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)$"
       },
       "limit": {
        "default": 20,
        "type": "integer",
        "minimum": 1,
        "maximum": 100
       }
      },
      "required": [
       "contactId"
      ]
     },
     "returns": "{\n  items: ContactTimelineItem[];\n  failures: Failure[];\n}"
    },
    {
     "name": "create",
     "summary": "Add a contact",
     "kind": "create",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
       },
       "emails": {
        "type": "array",
        "items": {
         "type": "string",
         "maxLength": 254
        }
       },
       "phone": {
        "anyOf": [
         {
          "type": "string",
          "maxLength": 80
         },
         {
          "type": "null"
         }
        ]
       },
       "jobTitle": {
        "anyOf": [
         {
          "type": "string",
          "maxLength": 200
         },
         {
          "type": "null"
         }
        ]
       },
       "labels": {
        "type": "array",
        "items": {
         "type": "string",
         "minLength": 1,
         "maxLength": 40
        }
       },
       "companyIds": {
        "type": "array",
        "items": {
         "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)$"
        }
       },
       "fields": {
        "default": {},
        "type": "object",
        "propertyNames": {
         "type": "string"
        },
        "additionalProperties": {}
       }
      },
      "required": [
       "name"
      ]
     },
     "returns": "ContactRecord | {\n  id: unknown;\n  message: string;\n}"
    },
    {
     "name": "add_many",
     "summary": "Add up to 200 people at once; company is a name (the workspace's own, made if new). Addresses already on a contact are reported, not added twice",
     "kind": "create",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "people": {
        "minItems": 1,
        "maxItems": 200,
        "type": "array",
        "items": {
         "type": "object",
         "propertyNames": {
          "type": "string"
         },
         "additionalProperties": {}
        }
       }
      },
      "required": [
       "people"
      ]
     },
     "returns": "{\n  added: {\n    id: string;\n    name: string;\n  }[];\n  existing: {\n    id: string;\n    name: string;\n    email: string;\n  }[];\n  invalid: {\n    row: number;\n    name: string | null;\n    error: string;\n  }[];\n}"
    },
    {
     "name": "update",
     "summary": "Change fields and labels",
     "kind": "change",
     "checked": true,
     "note": false,
     "undo": false,
     "quiet": true,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "allOf": [
       {
        "type": "object",
        "properties": {
         "contactId": {
          "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)$"
         }
        },
        "required": [
         "contactId"
        ]
       },
       {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
         },
         "emails": {
          "type": "array",
          "items": {
           "type": "string",
           "maxLength": 254
          }
         },
         "phone": {
          "anyOf": [
           {
            "type": "string",
            "maxLength": 80
           },
           {
            "type": "null"
           }
          ]
         },
         "jobTitle": {
          "anyOf": [
           {
            "type": "string",
            "maxLength": 200
           },
           {
            "type": "null"
           }
          ]
         },
         "labels": {
          "type": "array",
          "items": {
           "type": "string",
           "minLength": 1,
           "maxLength": 40
          }
         },
         "fields": {
          "type": "object",
          "propertyNames": {
           "type": "string"
          },
          "additionalProperties": {}
         }
        }
       }
      ]
     },
     "returns": "{\n  id: string;\n  organizationId: string;\n  name: string;\n  emails: string[];\n  phone: string | null;\n  jobTitle: string | null;\n  labels: string[];\n  context: string | null;\n  open: {\n    id: string;\n    kind: \"you\" | \"them\" | \"follow_up\";\n    text: string;\n    at: string;\n    thread?: string;\n    link?: string;\n    by?: {\n      kind: \"agent\" | \"user\" | \"system\";\n      id: string;\n    };\n  }[];\n  last: ContactLast;\n  fields: ContactFreeFields;\n  status: \"active\" | \"suggested\" | \"ignored\";\n  companies: CompanyRef[];\n  projects: ProjectRef[];\n  createdAt: string;\n  updatedAt: string;\n}"
    },
    {
     "name": "context",
     "summary": "Set Context and record why it changed; can be undone",
     "kind": "change",
     "checked": true,
     "note": false,
     "undo": true,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "contactId": {
        "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)$"
       },
       "text": {
        "type": "string",
        "maxLength": 1500
       },
       "why": {
        "type": "string",
        "minLength": 1,
        "maxLength": 2000
       }
      },
      "required": [
       "contactId",
       "text",
       "why"
      ]
     },
     "returns": "{\n  contact: ContactRecord;\n  entryId: string;\n}"
    },
    {
     "name": "note",
     "summary": "Add a dated note",
     "kind": "create",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": true,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "contactId": {
        "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)$"
       },
       "text": {
        "type": "string",
        "minLength": 1,
        "maxLength": 2000
       }
      },
      "required": [
       "contactId",
       "text"
      ]
     },
     "returns": "{\n  id: string;\n  at: string;\n  by: {\n    kind: \"agent\" | \"user\" | \"system\";\n    id: string;\n  };\n  kind: \"removed\" | \"note\" | \"ask\" | \"context\" | \"labels\" | \"created\" | \"sent\" | \"drafted\" | \"triage\" | \"looked\" | \"merged\" | \"restored\";\n  text?: string;\n  before?: string | string[] | null;\n  after?: string | string[] | null;\n  why?: string;\n  subject?: string;\n  to?: string[];\n  thread?: string;\n  link?: string;\n  hold?: number;\n  sentAt?: string;\n  approval?: {\n    kind: \"rule\" | \"allowed\" | \"waiting\" | \"yes\" | \"undone\" | \"declined\";\n    at?: string;\n    rule?: string;\n  };\n}"
    },
    {
     "name": "follow_up",
     "summary": "Add a follow-up for this agent; at is an ISO date and time",
     "kind": "create",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": true,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "contactId": {
        "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)$"
       },
       "text": {
        "type": "string",
        "minLength": 1,
        "maxLength": 2000
       },
       "at": {
        "type": "string",
        "format": "date-time",
        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
       }
      },
      "required": [
       "contactId",
       "text",
       "at"
      ]
     },
     "returns": "{\n  id: string;\n  organizationId: string;\n  name: string;\n  emails: string[];\n  phone: string | null;\n  jobTitle: string | null;\n  labels: string[];\n  context: string | null;\n  open: {\n    id: string;\n    kind: \"you\" | \"them\" | \"follow_up\";\n    text: string;\n    at: string;\n    thread?: string;\n    link?: string;\n    by?: {\n      kind: \"agent\" | \"user\" | \"system\";\n      id: string;\n    };\n  }[];\n  last: ContactLast;\n  fields: ContactFreeFields;\n  status: \"active\" | \"suggested\" | \"ignored\";\n  companies: CompanyRef[];\n  projects: ProjectRef[];\n  createdAt: string;\n  updatedAt: string;\n}"
    },
    {
     "name": "link_project",
     "summary": "Link a contact to a project",
     "kind": "create",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": true,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "contactId": {
        "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)$"
       },
       "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)$"
       }
      },
      "required": [
       "contactId",
       "projectId"
      ]
     },
     "returns": "{\n  projectId: string;\n  contactId: string;\n}"
    }
   ]
  },
  {
   "name": "companies",
   "label": "Companies",
   "about": "the businesses the owner deals with: clients, suppliers, their conversations",
   "description": "The businesses the owner deals with, shared by all the owner's agents: each with its people and their roles, a Context, details such as terms, an About from the web, and a timeline. Read a company before you work for it. Its timeline is its conversations with the business, one entry per thread, meeting, call or invoice: after one, record what was said or decided, and recording the same thread again updates its entry. ours is who wrote for the business: your agent id when you did; leave it out when the owner did. Fix an entry by recording it again with its entryId; take one off only when the owner asks. Never record your own steps, automated mail or newsletters. Work about a company goes to its handler.",
   "research": false,
   "ownWrites": true,
   "tools": [
    {
     "name": "list",
     "summary": "Companies with labels, people, what's open, last contact and handler",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "label": {
        "type": "string",
        "minLength": 1,
        "maxLength": 40
       },
       "query": {
        "type": "string",
        "maxLength": 200
       },
       "open": {
        "type": "string",
        "enum": [
         "you",
         "them",
         "follow_up"
        ]
       },
       "quietDays": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
       },
       "handledBy": {
        "type": "string",
        "minLength": 1,
        "maxLength": 80
       },
       "offset": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
       }
      }
     },
     "returns": "{\n  items: CompanyRow[];\n  nextOffset: number | null;\n  total: number;\n}"
    },
    {
     "name": "read",
     "summary": "Everything to know before working for a company: Context, details, About, people with roles, open, newest 20 conversations",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "companyId": {
        "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)$"
       }
      },
      "required": [
       "companyId"
      ]
     },
     "returns": "{\n  timeline: {\n    id: string;\n    kind: \"note\" | \"mail\" | \"invoice\" | \"meeting\" | \"call\";\n    title: string;\n    at: string;\n    people: {\n      name: string;\n      id?: string;\n    }[];\n    ours: {\n      kind: \"agent\" | \"user\" | \"system\";\n      id: string;\n    }[];\n    by: {\n      kind: \"agent\" | \"user\" | \"system\";\n      id: string;\n    };\n    updatedAt: string;\n    summary?: string;\n    count?: number;\n    minutes?: number;\n    link?: string;\n    thread?: string;\n    files?: {\n      name: string;\n      link?: string;\n    }[];\n    state?: \"overdue\" | \"paid\" | \"waiting_you\" | \"waiting_them\";\n  }[];\n  id: string;\n  name: string;\n  website: string | null;\n  domains: string[];\n  labels: string[];\n  context: string | null;\n  contextBy: {\n    kind: \"agent\" | \"user\" | \"system\";\n    id: string;\n  } | null;\n  contextAt: string | null;\n  details: Record<string, string>;\n  about: CompanyAbout | null;\n  handler: string | null;\n  firstOnMail: boolean;\n  alwaysAsk: boolean;\n  listed: {\n    id: string;\n    name: string;\n    ticker: string | null;\n  } | null;\n  files: CompanyFile[];\n  open: {\n    id: string;\n    kind: \"you\" | \"them\" | \"follow_up\";\n    text: string;\n    at: string;\n    thread?: string;\n    link?: string;\n    by?: {\n      kind: \"agent\" | \"user\" | \"system\";\n      id: string;\n    };\n  }[];\n  people: CompanyPerson[];\n  known: string | null;\n  last: string | null;\n  counts: {\n    timeline: number;\n    projects: number;\n    docs: number;\n    files: number;\n  };\n  createdAt: string;\n  updatedAt: string;\n}"
    },
    {
     "name": "create",
     "summary": "Add a company; people are contact ids, a role each",
     "kind": "create",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
       },
       "website": {
        "type": "string",
        "minLength": 1,
        "maxLength": 300
       },
       "domains": {
        "maxItems": 10,
        "type": "array",
        "items": {
         "type": "string",
         "minLength": 1,
         "maxLength": 200
        }
       },
       "labels": {
        "maxItems": 20,
        "type": "array",
        "items": {
         "type": "string",
         "minLength": 1,
         "maxLength": 40
        }
       },
       "handler": {
        "type": "string",
        "minLength": 1,
        "maxLength": 80
       },
       "people": {
        "maxItems": 200,
        "type": "array",
        "items": {
         "type": "object",
         "properties": {
          "contactId": {
           "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)$"
          },
          "role": {
           "type": "string",
           "minLength": 1,
           "maxLength": 200
          }
         },
         "required": [
          "contactId"
         ]
        }
       }
      },
      "required": [
       "name"
      ]
     },
     "returns": "CompanyRecord | {\n  message: string;\n}"
    },
    {
     "name": "update",
     "summary": "Change a company's name, domains, labels, handler (an agent id) or details (named facts such as Terms; null clears one)",
     "kind": "change",
     "checked": true,
     "note": false,
     "undo": false,
     "quiet": true,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "companyId": {
        "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)$"
       },
       "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
       },
       "domains": {
        "maxItems": 10,
        "type": "array",
        "items": {
         "type": "string",
         "minLength": 1,
         "maxLength": 200
        }
       },
       "labels": {
        "maxItems": 20,
        "type": "array",
        "items": {
         "type": "string",
         "minLength": 1,
         "maxLength": 40
        }
       },
       "handler": {
        "anyOf": [
         {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
         },
         {
          "type": "null"
         }
        ]
       },
       "details": {
        "type": "object",
        "propertyNames": {
         "type": "string",
         "minLength": 1,
         "maxLength": 40
        },
        "additionalProperties": {
         "anyOf": [
          {
           "type": "string",
           "maxLength": 300
          },
          {
           "type": "null"
          }
         ]
        }
       },
       "why": {
        "type": "string",
        "minLength": 1,
        "maxLength": 2000
       }
      },
      "required": [
       "companyId",
       "why"
      ]
     },
     "returns": "{\n  id: string;\n  name: string;\n  website: string | null;\n  domains: string[];\n  labels: string[];\n  context: string | null;\n  contextBy: {\n    kind: \"agent\" | \"user\" | \"system\";\n    id: string;\n  } | null;\n  contextAt: string | null;\n  details: Record<string, string>;\n  about: CompanyAbout | null;\n  handler: string | null;\n  firstOnMail: boolean;\n  alwaysAsk: boolean;\n  listed: {\n    id: string;\n    name: string;\n    ticker: string | null;\n  } | null;\n  files: CompanyFile[];\n  open: {\n    id: string;\n    kind: \"you\" | \"them\" | \"follow_up\";\n    text: string;\n    at: string;\n    thread?: string;\n    link?: string;\n    by?: {\n      kind: \"agent\" | \"user\" | \"system\";\n      id: string;\n    };\n  }[];\n  people: CompanyPerson[];\n  known: string | null;\n  last: string | null;\n  counts: {\n    timeline: number;\n    projects: number;\n    docs: number;\n    files: number;\n  };\n  createdAt: string;\n  updatedAt: string;\n}"
    },
    {
     "name": "about",
     "summary": "Replace a company's About from the web: text citing sources as [1], facts, dated news",
     "kind": "change",
     "checked": true,
     "note": false,
     "undo": false,
     "quiet": true,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "companyId": {
        "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)$"
       },
       "text": {
        "type": "string",
        "minLength": 1,
        "maxLength": 3000
       },
       "facts": {
        "maxItems": 12,
        "type": "array",
        "items": {
         "type": "object",
         "properties": {
          "label": {
           "type": "string",
           "minLength": 1,
           "maxLength": 40
          },
          "value": {
           "type": "string",
           "minLength": 1,
           "maxLength": 200
          }
         },
         "required": [
          "label",
          "value"
         ]
        }
       },
       "lately": {
        "maxItems": 10,
        "type": "array",
        "items": {
         "type": "object",
         "properties": {
          "date": {
           "type": "string",
           "format": "date",
           "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
          },
          "text": {
           "type": "string",
           "minLength": 1,
           "maxLength": 300
          },
          "source": {
           "type": "integer",
           "minimum": 1,
           "maximum": 9007199254740991
          }
         },
         "required": [
          "date",
          "text"
         ]
        }
       },
       "sources": {
        "minItems": 1,
        "maxItems": 20,
        "type": "array",
        "items": {
         "type": "object",
         "properties": {
          "title": {
           "type": "string",
           "minLength": 1,
           "maxLength": 200
          },
          "url": {
           "type": "string",
           "format": "uri"
          }
         },
         "required": [
          "title",
          "url"
         ]
        }
       }
      },
      "required": [
       "companyId",
       "text",
       "sources"
      ]
     },
     "returns": "{\n  id: string;\n  name: string;\n  website: string | null;\n  domains: string[];\n  labels: string[];\n  context: string | null;\n  contextBy: {\n    kind: \"agent\" | \"user\" | \"system\";\n    id: string;\n  } | null;\n  contextAt: string | null;\n  details: Record<string, string>;\n  about: CompanyAbout | null;\n  handler: string | null;\n  firstOnMail: boolean;\n  alwaysAsk: boolean;\n  listed: {\n    id: string;\n    name: string;\n    ticker: string | null;\n  } | null;\n  files: CompanyFile[];\n  open: {\n    id: string;\n    kind: \"you\" | \"them\" | \"follow_up\";\n    text: string;\n    at: string;\n    thread?: string;\n    link?: string;\n    by?: {\n      kind: \"agent\" | \"user\" | \"system\";\n      id: string;\n    };\n  }[];\n  people: CompanyPerson[];\n  known: string | null;\n  last: string | null;\n  counts: {\n    timeline: number;\n    projects: number;\n    docs: number;\n    files: number;\n  };\n  createdAt: string;\n  updatedAt: string;\n}"
    },
    {
     "name": "timeline",
     "summary": "A company's conversations, newest first; before is the last item's at",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "companyId": {
        "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)$"
       },
       "kind": {
        "type": "string",
        "enum": [
         "mail",
         "meeting",
         "call",
         "invoice",
         "note"
        ]
       },
       "contactId": {
        "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)$"
       },
       "query": {
        "type": "string",
        "maxLength": 200
       },
       "before": {
        "type": "string"
       }
      },
      "required": [
       "companyId"
      ]
     },
     "returns": "{\n  items: {\n    id: string;\n    kind: \"note\" | \"mail\" | \"invoice\" | \"meeting\" | \"call\";\n    title: string;\n    at: string;\n    people: {\n      name: string;\n      id?: string;\n    }[];\n    ours: {\n      kind: \"agent\" | \"user\" | \"system\";\n      id: string;\n    }[];\n    by: {\n      kind: \"agent\" | \"user\" | \"system\";\n      id: string;\n    };\n    updatedAt: string;\n    summary?: string;\n    count?: number;\n    minutes?: number;\n    link?: string;\n    thread?: string;\n    files?: {\n      name: string;\n      link?: string;\n    }[];\n    state?: \"overdue\" | \"paid\" | \"waiting_you\" | \"waiting_them\";\n  }[];\n  total: number;\n  counts: {\n    [k: string]: number;\n  };\n  nextBefore: string | null;\n}"
    },
    {
     "name": "record",
     "summary": "Add a conversation to a company's timeline, or update it: same entryId, thread or link. people: contact ids or addresses on their side; ours: agent ids that wrote for the business, else the owner",
     "kind": "create",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": true,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "companyId": {
        "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)$"
       },
       "entryId": {
        "type": "string"
       },
       "kind": {
        "type": "string",
        "enum": [
         "mail",
         "meeting",
         "call",
         "invoice",
         "note"
        ]
       },
       "title": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
       },
       "summary": {
        "type": "string",
        "maxLength": 1000
       },
       "at": {
        "type": "string",
        "format": "date-time",
        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
       },
       "people": {
        "maxItems": 20,
        "type": "array",
        "items": {
         "type": "string",
         "minLength": 1,
         "maxLength": 254
        }
       },
       "ours": {
        "maxItems": 10,
        "type": "array",
        "items": {
         "type": "string",
         "minLength": 1,
         "maxLength": 80
        }
       },
       "count": {
        "type": "integer",
        "minimum": 1,
        "maximum": 9007199254740991
       },
       "minutes": {
        "type": "integer",
        "minimum": 1,
        "maximum": 9007199254740991
       },
       "link": {
        "type": "string",
        "format": "uri"
       },
       "thread": {
        "type": "string"
       },
       "files": {
        "maxItems": 20,
        "type": "array",
        "items": {
         "type": "object",
         "properties": {
          "name": {
           "type": "string",
           "minLength": 1,
           "maxLength": 200
          },
          "link": {
           "type": "string",
           "format": "uri"
          }
         },
         "required": [
          "name"
         ]
        }
       },
       "state": {
        "anyOf": [
         {
          "type": "string",
          "enum": [
           "waiting_you",
           "waiting_them",
           "paid",
           "overdue"
          ]
         },
         {
          "type": "null"
         }
        ]
       }
      },
      "required": [
       "companyId",
       "kind",
       "title",
       "at"
      ]
     },
     "returns": "{\n  entry: {\n    id: string;\n    kind: \"note\" | \"mail\" | \"invoice\" | \"meeting\" | \"call\";\n    title: string;\n    at: string;\n    people: {\n      name: string;\n      id?: string;\n    }[];\n    ours: {\n      kind: \"agent\" | \"user\" | \"system\";\n      id: string;\n    }[];\n    by: {\n      kind: \"agent\" | \"user\" | \"system\";\n      id: string;\n    };\n    updatedAt: string;\n    summary?: string;\n    count?: number;\n    minutes?: number;\n    link?: string;\n    thread?: string;\n    files?: {\n      name: string;\n      link?: string;\n    }[];\n    state?: \"overdue\" | \"paid\" | \"waiting_you\" | \"waiting_them\";\n  };\n  updated: boolean;\n}"
    },
    {
     "name": "unrecord",
     "summary": "Take an entry off a company's timeline; the owner can undo it",
     "kind": "delete",
     "checked": true,
     "note": false,
     "undo": false,
     "quiet": true,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "companyId": {
        "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)$"
       },
       "entryId": {
        "type": "string",
        "minLength": 1
       }
      },
      "required": [
       "companyId",
       "entryId"
      ]
     },
     "returns": "{\n  historyId: string;\n}"
    },
    {
     "name": "open",
     "summary": "Open an item on a company (a follow-up at a time wakes you), or close one by id",
     "kind": "depends",
     "checked": null,
     "note": false,
     "undo": false,
     "quiet": true,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "companyId": {
        "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)$"
       },
       "add": {
        "type": "object",
        "properties": {
         "kind": {
          "type": "string",
          "enum": [
           "you",
           "them",
           "follow_up"
          ]
         },
         "text": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
         },
         "at": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
         }
        },
        "required": [
         "kind",
         "text"
        ]
       },
       "done": {
        "type": "string"
       }
      },
      "required": [
       "companyId"
      ]
     },
     "returns": "{\n  id: string;\n  name: string;\n  website: string | null;\n  domains: string[];\n  labels: string[];\n  context: string | null;\n  contextBy: {\n    kind: \"agent\" | \"user\" | \"system\";\n    id: string;\n  } | null;\n  contextAt: string | null;\n  details: Record<string, string>;\n  about: CompanyAbout | null;\n  handler: string | null;\n  firstOnMail: boolean;\n  alwaysAsk: boolean;\n  listed: {\n    id: string;\n    name: string;\n    ticker: string | null;\n  } | null;\n  files: CompanyFile[];\n  open: {\n    id: string;\n    kind: \"you\" | \"them\" | \"follow_up\";\n    text: string;\n    at: string;\n    thread?: string;\n    link?: string;\n    by?: {\n      kind: \"agent\" | \"user\" | \"system\";\n      id: string;\n    };\n  }[];\n  people: CompanyPerson[];\n  known: string | null;\n  last: string | null;\n  counts: {\n    timeline: number;\n    projects: number;\n    docs: number;\n    files: number;\n  };\n  createdAt: string;\n  updatedAt: string;\n}"
    },
    {
     "name": "context",
     "summary": "Set a company's Context: what everyone should know about working with them",
     "kind": "change",
     "checked": true,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "companyId": {
        "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)$"
       },
       "text": {
        "type": "string",
        "maxLength": 1500
       },
       "why": {
        "type": "string",
        "minLength": 1,
        "maxLength": 2000
       }
      },
      "required": [
       "companyId",
       "text",
       "why"
      ]
     },
     "returns": "{\n  id: string;\n  name: string;\n  website: string | null;\n  domains: string[];\n  context: string | null;\n  contextBy: {\n    kind: \"agent\" | \"user\" | \"system\";\n    id: string;\n  } | null;\n  contextAt: string | null;\n  owned: boolean;\n}"
    },
    {
     "name": "link_person",
     "summary": "Link a person to a company, or change the link: role, since, ended (dates)",
     "kind": "create",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": true,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "contactId": {
        "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)$"
       },
       "companyId": {
        "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)$"
       },
       "role": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
       },
       "since": {
        "type": "string",
        "format": "date",
        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
       },
       "ended": {
        "type": "string",
        "format": "date",
        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
       }
      },
      "required": [
       "contactId",
       "companyId"
      ]
     },
     "returns": "{\n  contactId: string;\n  companyId: string;\n}"
    }
   ]
  },
  {
   "name": "web",
   "label": "Web",
   "about": "search the web and read pages",
   "description": "The open web. Results carry their links: say which page a fact came from.",
   "research": false,
   "ownWrites": false,
   "tools": [
    {
     "name": "search",
     "summary": "Pages that answer the objective, each with its link and the passages that matter",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "objective": {
        "type": "string",
        "minLength": 1,
        "maxLength": 500
       },
       "queries": {
        "minItems": 1,
        "maxItems": 4,
        "type": "array",
        "items": {
         "type": "string",
         "minLength": 1,
         "maxLength": 120
        }
       },
       "limit": {
        "type": "integer",
        "minimum": 1,
        "maximum": 10
       }
      },
      "required": [
       "objective",
       "queries"
      ]
     },
     "returns": "{\n  results: {\n    title: string | null;\n    url: string;\n    published: string | null;\n    excerpts: string[];\n  }[];\n}"
    },
    {
     "name": "read",
     "summary": "The text of up to 5 pages; with an objective, only the passages that bear on it",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "urls": {
        "minItems": 1,
        "maxItems": 5,
        "type": "array",
        "items": {
         "type": "string",
         "format": "uri"
        }
       },
       "objective": {
        "type": "string",
        "minLength": 1,
        "maxLength": 500
       }
      },
      "required": [
       "urls"
      ]
     },
     "returns": "{\n  pages: {\n    title: string | null;\n    url: string;\n    text: string;\n  }[];\n  failed: {\n    url: string;\n    error: string;\n  }[];\n}"
    }
   ]
  },
  {
   "name": "pages",
   "label": "Pages",
   "about": "research pages",
   "description": "Research pages in this workspace: question and thesis pages the reporter writes.",
   "research": true,
   "ownWrites": false,
   "tools": [
    {
     "name": "list",
     "summary": "Pages, newest first",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "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)$"
       },
       "title": {
        "type": "string",
        "maxLength": 300
       },
       "type": {
        "type": "string",
        "enum": [
         "question",
         "thesis"
        ]
       },
       "status": {
        "type": "string",
        "enum": [
         "queued",
         "running",
         "failed",
         "published"
        ]
       },
       "offset": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
       }
      }
     },
     "returns": "{\n  items: {\n    id: string;\n    title: string;\n    type: \"question\" | \"thesis\" | \"doc\";\n    projectId: string;\n    projectName: string;\n    status: \"draft\" | \"published\" | \"archived\";\n    generationStatus: \"queued\" | \"running\" | \"failed\" | \"completed\" | null;\n    updatedAt: string;\n  }[];\n  nextOffset: number | null;\n}"
    },
    {
     "name": "read",
     "summary": "A page with its content and sources",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "pageId": {
        "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)$"
       }
      },
      "required": [
       "pageId"
      ]
     },
     "returns": "{\n  state: \"doc\";\n  projectId: string;\n  organizationId: string;\n  agentId: string | null;\n  page: {\n    id: string;\n    title: string;\n    type: \"doc\";\n  };\n} | {\n  projectId: string;\n  organizationId: string;\n  agentId: string | null;\n  errorMessage: string;\n  page: {\n    id: string;\n    slug: string;\n    title: string;\n    type: \"question\" | \"thesis\";\n  };\n  state: \"failed\";\n  phase?: undefined;\n} | {\n  projectId: string;\n  organizationId: string;\n  agentId: string | null;\n  page: {\n    id: string;\n    slug: string;\n    title: string;\n    type: \"question\" | \"thesis\";\n  };\n  phase: \"queued\" | \"writing\" | \"researching\" | \"verifying\";\n  state: \"generating\";\n  errorMessage?: undefined;\n} | {\n  page: {\n    id: string;\n    title: string;\n    type: \"question\" | \"thesis\";\n  };\n  projectId: string;\n  organizationId: string;\n  agentId: string | null;\n  state: \"unavailable\";\n} | {\n  projectId: string;\n  organizationId: string;\n  agentId: string | null;\n  type: \"question\";\n  author: {\n    image: string | null;\n    name: string;\n  };\n  canonicalUrl: string;\n  description: string;\n  currentRevisionId: string | null;\n  id: string;\n  isAuthenticated: boolean;\n  isFollowing: boolean;\n  isStarred: boolean;\n  isPublished: boolean;\n  model: GeneratedPageDocumentModel;\n  publishedAt: string;\n  slug: string;\n  state: \"ready\";\n  starCount: number;\n  wordCount: number;\n  page?: undefined;\n} | {\n  projectId: string;\n  organizationId: string;\n  agentId: string | null;\n  type: \"thesis\";\n  state: \"ready\";\n  id: string;\n  slug: string;\n  model: {\n    artifact: {\n      type: \"thesis\";\n      version: 1;\n      horizon: \"1-2\" | \"2-5\" | \"5-10\";\n      relatedQuestion: {\n        id: string;\n        title: string;\n        slug: string;\n      } | null;\n      asOf: string;\n      assessment: {\n        summaryMarkdown: string;\n        bodyMdx: string;\n        conviction: \"low\" | \"medium\" | \"high\" | \"insufficient\";\n        rationaleMarkdown: string;\n        changeConditions: string[];\n      };\n      pillars: {\n        id: string;\n        side: \"for\" | \"against\";\n        title: string;\n        explanationMarkdown: string;\n      }[];\n      articles: {\n        date: string | null;\n        datePrecision: \"day\" | \"month\" | \"year\" | null;\n        stance: \"supporting\" | \"challenging\" | \"mixed\";\n        pillarIds: string[];\n        relevanceMarkdown: string;\n        documentId: string;\n        title: string;\n        url: string;\n        author: string | null;\n        imageUrl: string | null;\n        confidence: \"low\" | \"medium\" | \"high\" | null;\n      }[];\n    };\n    title: string;\n  };\n  author: {\n    image: string | null;\n    name: string;\n  };\n  canonicalUrl: string;\n  description: string;\n  currentRevisionId: string | null;\n  isPublished: boolean;\n  isAuthenticated: boolean;\n  isFollowing: boolean;\n  isStarred: boolean;\n  starCount: number;\n  firstPublishedAt: string | null;\n  publishedAt: string | null;\n  page?: undefined;\n}"
    },
    {
     "name": "request",
     "summary": "Start a research page on a question, in the project the owner names, else the one you file into. A page costs money and has no price up front",
     "kind": "create",
     "checked": true,
     "note": true,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "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)$"
       },
       "question": {
        "type": "string",
        "minLength": 1,
        "maxLength": 2000
       },
       "context": {
        "type": "string",
        "maxLength": 4000
       }
      },
      "required": [
       "question"
      ]
     },
     "returns": "{\n  pageId: string;\n  slug: string;\n  generationToken: string;\n  status: \"queued\" | \"running\" | \"failed\" | \"completed\";\n}"
    },
    {
     "name": "update",
     "summary": "Change figures in a page the owner requested, each edit replacing words the page has now; label names the figure",
     "kind": "change",
     "checked": true,
     "note": false,
     "undo": true,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "pageId": {
        "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)$"
       },
       "title": {
        "type": "string",
        "maxLength": 200
       },
       "edits": {
        "minItems": 1,
        "maxItems": 12,
        "type": "array",
        "items": {
         "type": "object",
         "properties": {
          "label": {
           "type": "string",
           "minLength": 1,
           "maxLength": 120
          },
          "find": {
           "type": "string",
           "minLength": 1,
           "maxLength": 2000
          },
          "replace": {
           "type": "string",
           "maxLength": 2000
          },
          "was": {
           "type": "string",
           "maxLength": 60
          },
          "now": {
           "type": "string",
           "maxLength": 60
          }
         },
         "required": [
          "label",
          "find",
          "replace"
         ]
        }
       },
       "sentence": {
        "type": "object",
        "properties": {
         "before": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
         },
         "after": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
         }
        },
        "required": [
         "before",
         "after"
        ]
       },
       "source": {
        "type": "object",
        "properties": {
         "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
         },
         "href": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
         }
        },
        "required": [
         "label",
         "href"
        ]
       },
       "quote": {
        "type": "string",
        "maxLength": 1000
       }
      },
      "required": [
       "pageId",
       "edits",
       "source"
      ]
     },
     "returns": "{\n  pageId: string;\n  replaced: string;\n  published: {\n    revisionId: string;\n    revisionNumber: number;\n  };\n}"
    },
    {
     "name": "move",
     "summary": "Move a page to another project",
     "kind": "change",
     "checked": true,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "pageId": {
        "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)$"
       },
       "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)$"
       }
      },
      "required": [
       "pageId",
       "projectId"
      ]
     },
     "returns": "{\n  id: string;\n  projectId: string | null;\n}"
    },
    {
     "name": "mark",
     "summary": "Star or follow a page",
     "kind": "create",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "pageId": {
        "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)$"
       },
       "action": {
        "type": "string",
        "enum": [
         "star",
         "follow"
        ]
       },
       "enabled": {
        "type": "boolean"
       }
      },
      "required": [
       "pageId",
       "action",
       "enabled"
      ]
     },
     "returns": "{\n  pageId: string;\n  action: \"star\" | \"follow\";\n  enabled: boolean;\n}"
    }
   ]
  },
  {
   "name": "comments",
   "label": "Comments",
   "about": "comments on pages",
   "description": "Comments on pages. What an agent writes shows as Roadstar, like an @roadstar reply.",
   "research": true,
   "ownWrites": false,
   "tools": [
    {
     "name": "list",
     "summary": "A page's comments",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "pageId": {
        "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)$"
       }
      },
      "required": [
       "pageId"
      ]
     },
     "returns": "CommentWindowResult"
    },
    {
     "name": "comment",
     "summary": "Comment on a page, or reply to a comment",
     "kind": "create",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "pageId": {
        "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)$"
       },
       "text": {
        "type": "string",
        "minLength": 1,
        "maxLength": 10000
       },
       "parentId": {
        "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)$"
       }
      },
      "required": [
       "pageId",
       "text"
      ]
     },
     "returns": "{\n  commentId: string;\n}"
    }
   ]
  },
  {
   "name": "projects",
   "label": "Projects",
   "about": "projects that hold docs, pages and tables",
   "description": "Projects group the owner's docs, tables and contacts, and every doc goes in one. Use the project the owner named; else list them and pick the one the work belongs to, or create one named after the job.",
   "research": false,
   "ownWrites": false,
   "tools": [
    {
     "name": "list",
     "summary": "Every project in the workspace",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "offset": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
       }
      }
     },
     "returns": "{\n  items: {\n    id: string;\n    organizationId: string;\n    name: string;\n    description: string;\n    createdByUserId: string | null;\n    updatedByUserId: string | null;\n    createdAt: string;\n    updatedAt: string;\n  }[];\n  nextOffset: number | null;\n}"
    },
    {
     "name": "activity",
     "summary": "Recent changes across the workspace",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "offset": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
       }
      }
     },
     "returns": "{\n  items: WorkspaceActivityItem[];\n  nextOffset: number | null;\n}"
    },
    {
     "name": "create",
     "summary": "Create a project",
     "kind": "create",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 120
       },
       "description": {
        "default": "",
        "type": "string",
        "maxLength": 4000
       }
      },
      "required": [
       "name"
      ]
     },
     "returns": "{\n  name: string;\n  description: string;\n  id: string;\n  createdAt: string;\n  organizationId: string;\n  createdByUserId: string | null;\n  updatedByUserId: string | null;\n  updatedAt: string;\n} | {\n  id: string;\n  organizationId: string;\n  name: string;\n  description: string;\n  createdByUserId: string | null;\n  updatedByUserId: string | null;\n  createdAt: string;\n  updatedAt: string;\n}"
    },
    {
     "name": "update",
     "summary": "Rename a project or change its description",
     "kind": "change",
     "checked": true,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "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)$"
       },
       "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 120
       },
       "description": {
        "type": "string",
        "maxLength": 4000
       }
      },
      "required": [
       "projectId",
       "name",
       "description"
      ]
     },
     "returns": "{\n  id: string;\n  organizationId: string;\n  name: string;\n  description: string;\n  createdByUserId: string | null;\n  updatedByUserId: string | null;\n  createdAt: string;\n  updatedAt: string;\n}"
    }
   ]
  },
  {
   "name": "tables",
   "label": "Tables",
   "about": "research tables",
   "description": "Research tables: agents find rows and fill each cell from a source. Builds cost money; Pro estimates the cost first.",
   "research": true,
   "ownWrites": false,
   "tools": [
    {
     "name": "list",
     "summary": "Tables",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "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)$"
       }
      }
     },
     "returns": "{\n  id: string;\n  name: string;\n  question: string;\n  projects: {\n    id: string;\n    name: string;\n  }[];\n  row: string;\n  columns: number;\n  updatedAt: string;\n  run: {\n    id: string;\n    kind: DatasetRunKind;\n    status: DatasetRunStatus;\n    estimateUsd: number;\n    capUsd: number;\n    spentUsd: number;\n    rowsTotal: number;\n    rowsDone: number;\n    message: string | null;\n    createdAt: string;\n    completedAt: string | null;\n  } | null;\n}[]"
    },
    {
     "name": "read",
     "summary": "A table's columns, rows and cell values",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "datasetId": {
        "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)$"
       }
      },
      "required": [
       "datasetId"
      ]
     },
     "returns": "{\n  dataset: {\n    id: string;\n    projects: {\n      id: string;\n      name: string;\n    }[];\n    name: string;\n    question: string;\n    plan: {\n      row: string;\n      rule: string;\n      queries: string[];\n      columns: {\n        name: string;\n        label: string;\n        type: \"number\" | \"date\" | \"text\" | \"choice\" | \"rating\" | \"yes_no\";\n        unit: string | null;\n        options: string[] | null;\n        instructions: string;\n        identifies: boolean;\n      }[];\n    };\n    createdAt: string;\n    agentId: string | null;\n    spentUsd: number;\n    run: {\n      id: string;\n      kind: DatasetRunKind;\n      status: DatasetRunStatus;\n      estimateUsd: number;\n      capUsd: number;\n      spentUsd: number;\n      rowsTotal: number;\n      rowsDone: number;\n      message: string | null;\n      createdAt: string;\n      completedAt: string | null;\n    } | null;\n  };\n  rows: StoredRow[];\n}"
    },
    {
     "name": "build",
     "summary": "Plan and build a new table, in the project the owner names, else the one you file into. It costs money by the row",
     "kind": "create",
     "checked": true,
     "note": true,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "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)$"
       },
       "question": {
        "type": "string",
        "minLength": 1,
        "maxLength": 2000
       },
       "maxRows": {
        "default": 25,
        "type": "integer",
        "minimum": 1,
        "maximum": 250
       }
      },
      "required": [
       "question"
      ]
     },
     "returns": "{\n  id: string;\n  projects: {\n    id: string;\n    name: string;\n  }[];\n  name: string;\n  question: string;\n  plan: {\n    row: string;\n    rule: string;\n    queries: string[];\n    columns: {\n      name: string;\n      label: string;\n      type: \"number\" | \"date\" | \"text\" | \"choice\" | \"rating\" | \"yes_no\";\n      unit: string | null;\n      options: string[] | null;\n      instructions: string;\n      identifies: boolean;\n    }[];\n  };\n  createdAt: string;\n  agentId: string | null;\n  spentUsd: number;\n  run: {\n    id: string;\n    kind: DatasetRunKind;\n    status: DatasetRunStatus;\n    estimateUsd: number;\n    capUsd: number;\n    spentUsd: number;\n    rowsTotal: number;\n    rowsDone: number;\n    message: string | null;\n    createdAt: string;\n    completedAt: string | null;\n  } | null;\n}"
    },
    {
     "name": "add_row",
     "summary": "Add a row by the columns that identify it",
     "kind": "create",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "datasetId": {
        "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)$"
       },
       "identity": {
        "type": "object",
        "propertyNames": {
         "type": "string"
        },
        "additionalProperties": {
         "type": "string"
        }
       }
      },
      "required": [
       "datasetId",
       "identity"
      ]
     },
     "returns": "{\n  key: string;\n}"
    },
    {
     "name": "research_rows",
     "summary": "Research some rows again. It costs money by the row",
     "kind": "change",
     "checked": true,
     "note": true,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "datasetId": {
        "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)$"
       },
       "rowKeys": {
        "minItems": 1,
        "maxItems": 250,
        "type": "array",
        "items": {
         "type": "string"
        }
       }
      },
      "required": [
       "datasetId",
       "rowKeys"
      ]
     },
     "returns": "{\n  id: string;\n  projects: {\n    id: string;\n    name: string;\n  }[];\n  name: string;\n  question: string;\n  plan: {\n    row: string;\n    rule: string;\n    queries: string[];\n    columns: {\n      name: string;\n      label: string;\n      type: \"number\" | \"date\" | \"text\" | \"choice\" | \"rating\" | \"yes_no\";\n      unit: string | null;\n      options: string[] | null;\n      instructions: string;\n      identifies: boolean;\n    }[];\n  };\n  createdAt: string;\n  agentId: string | null;\n  spentUsd: number;\n  run: {\n    id: string;\n    kind: DatasetRunKind;\n    status: DatasetRunStatus;\n    estimateUsd: number;\n    capUsd: number;\n    spentUsd: number;\n    rowsTotal: number;\n    rowsDone: number;\n    message: string | null;\n    createdAt: string;\n    completedAt: string | null;\n  } | null;\n}"
    },
    {
     "name": "accept_cell",
     "summary": "Accept a value waiting for review",
     "kind": "change",
     "checked": true,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "datasetId": {
        "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)$"
       },
       "key": {
        "type": "string"
       },
       "column": {
        "type": "string"
       }
      },
      "required": [
       "datasetId",
       "key",
       "column"
      ]
     },
     "returns": "{ done: true }"
    }
   ]
  },
  {
   "name": "filings",
   "label": "Filings",
   "about": "public companies' filings",
   "description": "SEC filings stored for companies: 10-K, 10-Q, 8-K, 20-F, proxies and more.",
   "research": true,
   "ownWrites": false,
   "tools": [
    {
     "name": "latest",
     "summary": "Each company's latest filings",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "companyIds": {
        "minItems": 1,
        "maxItems": 50,
        "type": "array",
        "items": {
         "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)$"
        }
       }
      },
      "required": [
       "companyIds"
      ]
     },
     "returns": "{\n  items: Pick<CompanyListItem, \"id\" | \"latestFiling\">[];\n}"
    },
    {
     "name": "read",
     "summary": "One filing's text",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "accession": {
        "type": "string",
        "minLength": 1,
        "maxLength": 40
       }
      },
      "required": [
       "accession"
      ]
     },
     "returns": "{\n  state: string;\n  title?: never;\n  url?: never;\n  text?: never;\n} | {\n  title: string | null;\n  url: string | null;\n  text: string;\n  state?: never;\n}"
    }
   ]
  },
  {
   "name": "newsfeed",
   "label": "Newsfeed",
   "about": "today's news",
   "description": "The workspace's newsfeed: stories it follows for the workspace's projects.",
   "research": true,
   "ownWrites": false,
   "tools": [
    {
     "name": "read",
     "summary": "Today's stories and what the feed follows",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {}
     },
     "returns": "{\n  stories: NewsfeedStory[];\n  projects: {\n    id: string;\n    name: string;\n  }[];\n  topics: {\n    label: string;\n    projectIds: string[];\n  }[];\n  accounts: {\n    handle: string;\n    projectIds: string[];\n    addedAt: string;\n  }[];\n  market: {\n    stories: NewsfeedStory[];\n    read: {\n      sentences: {\n        text: string;\n        storyIds: string[];\n      }[];\n      previous: string[];\n      writtenAt: string;\n      rewrites: number;\n    } | null;\n  };\n  brief: {\n    writtenAt: string;\n    projects: {\n      projectId: string;\n      effect: \"direct\" | \"indirect\" | \"quiet\";\n      text: string;\n    }[];\n  } | null;\n  actions: {\n    kind: \"match\" | \"follow\" | \"unfollow\";\n    text: string;\n    at: string;\n  }[];\n  today: {\n    counts: NewsfeedCount[];\n    stories: number;\n  };\n  strip: {\n    symbol: string;\n    name: string;\n    price: number;\n    changePercent: number;\n  }[];\n  pricedAt: string | null;\n  moves: Record<string, number>;\n  publishers: string[];\n  checkedAt: string | null;\n}"
    }
   ]
  },
  {
   "name": "docs",
   "label": "Docs",
   "about": "the business's docs: proposals, briefs, checklists",
   "description": "Docs you write for the owner and keep: SOPs and briefs, write-ups of your work, reports that recur. Write a doc when the work is long, structured or worth keeping; answer in a message otherwise. A doc you were asked to write already exists: write into its docId. A doc's text is MDX: Markdown (## headings, lists, tables, **bold**, links) plus <Callout kind=\"summary|key-point|note|warning|takeaway\" title=\"…\">…</Callout>, <MetricGrid><Metric label=\"…\" value=\"…\" detail=\"…\" /></MetricGrid>, <Columns count=\"2\">…</Columns>, and a chart as <Viz title=\"…\" description=\"…\"> holding one ```vega-lite JSON block with its data inline. Link people and things you read as roadstar links: [Juniper Dental](roadstar:contact/<id>); kinds: contact, email, file, invoice, bill, agent, doc, page, table, project. A report or tracker reads like a dashboard: one line on as of when and from what; a MetricGrid of the three or four figures that matter; a short table of what needs the owner; then one table of every item, a row each, in short cells: dates like Nov 6, amounts right-aligned (|---:|), a status of a word or two, each row's name linked to its source. A recurring one opens with what moved since the last. What you couldn't check goes in one line at the end; your own working notes stay out of it.",
   "research": false,
   "ownWrites": false,
   "tools": [
    {
     "name": "list",
     "summary": "Docs, newest first",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "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)$"
       },
       "title": {
        "type": "string",
        "maxLength": 300
       },
       "offset": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
       }
      }
     },
     "returns": "{\n  items: {\n    id: string;\n    title: string;\n    type: \"question\" | \"thesis\" | \"doc\";\n    projectId: string;\n    projectName: string;\n    status: \"draft\" | \"published\" | \"archived\";\n    generationStatus: \"queued\" | \"running\" | \"failed\" | \"completed\" | null;\n    updatedAt: string;\n  }[];\n  nextOffset: number | null;\n}"
    },
    {
     "name": "read",
     "summary": "A doc's current text, the brief it was asked with, what to read first, and the notes the owner sent you on it",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "docId": {
        "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)$"
       }
      },
      "required": [
       "docId"
      ]
     },
     "returns": "{\n  id: string;\n  title: string;\n  projectId: string | null;\n  brief: string | null;\n  readFirst: {\n    kind: \"page\" | \"table\" | \"doc\" | \"contact\";\n    id: string;\n    label: string;\n  }[];\n  updates: \"once\" | \"weekly\" | \"monthly\" | \"quarterly\";\n  text: string | null;\n  notes: {\n    noteId: string;\n    on: string;\n    note: string | null;\n  }[];\n}"
    },
    {
     "name": "write",
     "summary": "Write a doc's whole text: a new doc, the first draft of one you were asked for, or a full rewrite such as a routine's.",
     "kind": "depends",
     "checked": null,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "docId": {
        "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)$"
       },
       "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)$"
       },
       "title": {
        "type": "string",
        "minLength": 1,
        "maxLength": 300
       },
       "text": {
        "type": "string",
        "minLength": 1,
        "maxLength": 100000,
        "description": "MDX, as the docs how-to says"
       },
       "lines": {
        "description": "what changed, one plain sentence each, for the owner",
        "maxItems": 20,
        "type": "array",
        "items": {
         "type": "string",
         "minLength": 1,
         "maxLength": 300
        }
       }
      },
      "required": [
       "title",
       "text"
      ]
     },
     "returns": "{\n  pageId: string;\n  versionId: string;\n  version: number;\n}"
    },
    {
     "name": "edit",
     "summary": "Change parts of a doc you've read: each find is words it has now, once. All edits apply together or none; the rest stays as it is.",
     "kind": "change",
     "checked": true,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "docId": {
        "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)$"
       },
       "edits": {
        "minItems": 1,
        "maxItems": 30,
        "type": "array",
        "items": {
         "type": "object",
         "properties": {
          "find": {
           "type": "string",
           "minLength": 1,
           "maxLength": 20000
          },
          "replace": {
           "type": "string",
           "maxLength": 20000
          }
         },
         "required": [
          "find",
          "replace"
         ]
        }
       },
       "lines": {
        "description": "what changed, one plain sentence each, for the owner",
        "maxItems": 20,
        "type": "array",
        "items": {
         "type": "string",
         "minLength": 1,
         "maxLength": 300
        }
       },
       "answers": {
        "maxItems": 40,
        "type": "array",
        "items": {
         "type": "object",
         "properties": {
          "noteId": {
           "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)$"
          },
          "outcome": {
           "type": "string",
           "enum": [
            "changed",
            "kept"
           ]
          },
          "text": {
           "type": "string",
           "minLength": 1,
           "maxLength": 1000
          }
         },
         "required": [
          "noteId",
          "outcome",
          "text"
         ]
        },
        "description": "When the owner sent notes, answer every one: changed with what you did, or kept with why"
       }
      },
      "required": [
       "docId",
       "edits"
      ]
     },
     "returns": "{\n  pageId: string;\n  versionId: string;\n  version: number;\n}"
    },
    {
     "name": "answer",
     "summary": "Answer a note without changing the doc: kept, with why; or done, for a note that asked you to do something else, with what you did",
     "kind": "change",
     "checked": true,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "docId": {
        "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)$"
       },
       "noteId": {
        "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)$"
       },
       "outcome": {
        "type": "string",
        "enum": [
         "kept",
         "done"
        ]
       },
       "text": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1000
       }
      },
      "required": [
       "docId",
       "noteId",
       "outcome",
       "text"
      ]
     },
     "returns": "{\n  commentId: string;\n}"
    }
   ]
  },
  {
   "name": "files",
   "label": "Files",
   "about": "the owner's Drive: files, Google Docs and Sheets",
   "description": "The owner's files, such as Google Drive, searched live across every account they connected. Read a folder to work through it. A Drive link the owner pastes opens directly. Spreadsheets read tab by tab, pictures as images; a scanned PDF has no text, so search for its words instead. Google Drive: Drive matches words in names and file text, by relevance, not meaning: try other words when a search misses. OneDrive: OneDrive searches the files the owner can open in OneDrive and SharePoint with Microsoft Search: words, \"exact phrases\", filetype:xlsx, author:\"Name\". Older Office files such as .doc and .ppt are read from a PDF copy.",
   "research": false,
   "ownWrites": false,
   "tools": [
    {
     "name": "search",
     "summary": "Files whose name or text match, across the owner's accounts, and which accounts failed. nextPage, passed as page, gives more.",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "query": {
        "type": "string",
        "minLength": 1,
        "maxLength": 500
       },
       "source": {
        "description": "Only accounts whose name contains this, e.g. an email address",
        "type": "string",
        "maxLength": 120
       },
       "modifiedAfter": {
        "type": "string",
        "maxLength": 40
       },
       "limit": {
        "default": 10,
        "type": "integer",
        "minimum": 1,
        "maximum": 20
       },
       "page": {
        "type": "string",
        "maxLength": 4000
       }
      },
      "required": [
       "query"
      ]
     },
     "returns": "{\n  nextPage?: string;\n  hits: (Hit & {\n    source: string;\n  })[];\n  searched: string[];\n  failed: Failure[];\n}"
    },
    {
     "name": "read",
     "summary": "A file's text by id or Drive link, 30,000 characters at a time (nextOffset gives the rest), or a folder's items (nextPage gives more). A picture comes back as an image.",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "id": {
        "type": "string",
        "minLength": 3,
        "maxLength": 500
       },
       "offset": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
       },
       "page": {
        "type": "string",
        "maxLength": 4000
       }
      },
      "required": [
       "id"
      ]
     },
     "returns": "Content & {\n  id: string;\n  source: string;\n  nextOffset?: number;\n}"
    },
    {
     "name": "copy",
     "summary": "A copy of a file, such as a template, under a new name, in a folder (an id from search or folder) when given",
     "kind": "create",
     "checked": false,
     "note": false,
     "undo": true,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "id": {
        "type": "string",
        "minLength": 3,
        "maxLength": 500
       },
       "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
       },
       "folderId": {
        "type": "string",
        "minLength": 3,
        "maxLength": 500
       }
      },
      "required": [
       "id",
       "name"
      ]
     },
     "returns": "{\n  id: string;\n  name: string;\n  url: string;\n}"
    },
    {
     "name": "folder",
     "summary": "A new folder, inside another when parentId is given",
     "kind": "create",
     "checked": false,
     "note": false,
     "undo": true,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
       },
       "parentId": {
        "type": "string",
        "minLength": 3,
        "maxLength": 500
       }
      },
      "required": [
       "name"
      ]
     },
     "returns": "{\n  id: string;\n  name: string;\n  url: string;\n}"
    },
    {
     "name": "move",
     "summary": "Move files or folders into a folder, up to 50 at once",
     "kind": "change",
     "checked": true,
     "note": false,
     "undo": true,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "ids": {
        "minItems": 1,
        "maxItems": 50,
        "type": "array",
        "items": {
         "type": "string",
         "minLength": 3,
         "maxLength": 500
        }
       },
       "folderId": {
        "type": "string",
        "minLength": 3,
        "maxLength": 500
       }
      },
      "required": [
       "ids",
       "folderId"
      ]
     },
     "returns": "{\n  moved: {\n    id: string;\n    name: string;\n    from: string[];\n  }[];\n}"
    },
    {
     "name": "rename",
     "summary": "Rename a file or folder",
     "kind": "change",
     "checked": true,
     "note": false,
     "undo": true,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "id": {
        "type": "string",
        "minLength": 3,
        "maxLength": 500
       },
       "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
       }
      },
      "required": [
       "id",
       "name"
      ]
     },
     "returns": "{\n  before: string;\n  id: string;\n}"
    },
    {
     "name": "create_doc",
     "summary": "A new Google Doc written from Markdown: headings, lists, tables, bold and links",
     "kind": "create",
     "checked": false,
     "note": false,
     "undo": true,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
       },
       "markdown": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200000
       },
       "folderId": {
        "type": "string",
        "minLength": 3,
        "maxLength": 500
       }
      },
      "required": [
       "name",
       "markdown"
      ]
     },
     "returns": "{\n  id: string;\n  name: string;\n  url: string;\n}"
    },
    {
     "name": "append_text",
     "summary": "Add text as a new paragraph at the end of a Google Doc",
     "kind": "change",
     "checked": true,
     "note": false,
     "undo": true,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "id": {
        "type": "string",
        "minLength": 3,
        "maxLength": 500
       },
       "text": {
        "type": "string",
        "minLength": 1,
        "maxLength": 50000
       }
      },
      "required": [
       "id",
       "text"
      ]
     },
     "returns": "{\n  start: number;\n  end: number;\n  id: string;\n}"
    },
    {
     "name": "create_sheet",
     "summary": "A new Google Sheet from rows, the first row its headings",
     "kind": "create",
     "checked": false,
     "note": false,
     "undo": true,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
       },
       "rows": {
        "minItems": 1,
        "maxItems": 200,
        "type": "array",
        "items": {
         "type": "array",
         "items": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "number"
           }
          ]
         }
        }
       },
       "folderId": {
        "type": "string",
        "minLength": 3,
        "maxLength": 500
       }
      },
      "required": [
       "name",
       "rows"
      ]
     },
     "returns": "{\n  id: string;\n  name: string;\n  url: string;\n}"
    },
    {
     "name": "save",
     "summary": "Put a workspace file in Drive: a new file, or with over, a new version of the Drive file it was opened from",
     "kind": "depends",
     "checked": null,
     "note": false,
     "undo": true,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "workspace": {
        "type": "string",
        "minLength": 1,
        "maxLength": 500,
        "description": "Its path, such as shared/report.xlsx"
       },
       "folderId": {
        "description": "Where a new file goes",
        "type": "string",
        "minLength": 3,
        "maxLength": 500
       },
       "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
       },
       "asGoogle": {
        "description": "Makes an .xlsx, .docx or .pptx a Google file",
        "type": "boolean"
       },
       "over": {
        "description": "The Drive file it was opened from: open's from. Never a Google file",
        "type": "string",
        "minLength": 3,
        "maxLength": 500
       }
      },
      "required": [
       "workspace"
      ]
     },
     "returns": "{\n  id: string;\n  name: string;\n  url: string;\n}"
    },
    {
     "name": "save_attachment",
     "summary": "Save an email's attachment into Drive: attachment is its id from search (gmail:…:a:…). For mail not in search, email is the thread's id from mail search and attachment the id mail read listed",
     "kind": "create",
     "checked": false,
     "note": false,
     "undo": true,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "email": {
        "type": "string",
        "minLength": 3,
        "maxLength": 500
       },
       "attachment": {
        "type": "string",
        "minLength": 3,
        "maxLength": 300
       },
       "folderId": {
        "type": "string",
        "minLength": 3,
        "maxLength": 500
       },
       "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
       }
      },
      "required": [
       "attachment"
      ]
     },
     "returns": "{\n  id: string;\n  name: string;\n  url: string;\n}"
    },
    {
     "name": "sheet_rows",
     "summary": "A sheet's cells, such as \"Projects!A1:H50\"",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "id": {
        "type": "string",
        "minLength": 3,
        "maxLength": 500
       },
       "range": {
        "type": "string",
        "maxLength": 200
       }
      },
      "required": [
       "id",
       "range"
      ]
     },
     "returns": "{\n  values: Values;\n}"
    },
    {
     "name": "append_rows",
     "summary": "Add rows after a sheet's table, such as range \"Leads!A:F\"",
     "kind": "change",
     "checked": true,
     "note": false,
     "undo": true,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "id": {
        "type": "string",
        "minLength": 3,
        "maxLength": 500
       },
       "range": {
        "type": "string",
        "maxLength": 200
       },
       "values": {
        "minItems": 1,
        "maxItems": 200,
        "type": "array",
        "items": {
         "type": "array",
         "items": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "number"
           }
          ]
         }
        }
       }
      },
      "required": [
       "id",
       "range",
       "values"
      ]
     },
     "returns": "{\n  id: string;\n  updatedRange: string;\n}"
    },
    {
     "name": "update_cells",
     "summary": "Write over cells, such as a date in \"Projects!F12\"; their old values are kept for Undo",
     "kind": "change",
     "checked": true,
     "note": false,
     "undo": true,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "id": {
        "type": "string",
        "minLength": 3,
        "maxLength": 500
       },
       "range": {
        "type": "string",
        "maxLength": 200
       },
       "values": {
        "minItems": 1,
        "maxItems": 200,
        "type": "array",
        "items": {
         "type": "array",
         "items": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "number"
           }
          ]
         }
        }
       }
      },
      "required": [
       "id",
       "range",
       "values"
      ]
     },
     "returns": "{\n  id: string;\n  range: string;\n  before: string[][];\n}"
    },
    {
     "name": "replace_text",
     "summary": "Replace every match of some text in a Google Doc",
     "kind": "change",
     "checked": true,
     "note": false,
     "undo": true,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "id": {
        "type": "string",
        "minLength": 3,
        "maxLength": 500
       },
       "find": {
        "type": "string",
        "minLength": 1,
        "maxLength": 2000
       },
       "replace": {
        "type": "string",
        "maxLength": 5000
       }
      },
      "required": [
       "id",
       "find",
       "replace"
      ]
     },
     "returns": "{\n  id: string;\n  find: string;\n  replace: string;\n  changed: number;\n}"
    }
   ]
  },
  {
   "name": "mail",
   "label": "Mail",
   "about": "the owner's Gmail",
   "description": "The owner's mail, such as Gmail, searched live. A thread reads as its messages without quoted text; attachments read like files. Gmail's web links don't open here: search by sender and subject. Gmail: Gmail's query takes its search box syntax, and results come back newest first.",
   "research": false,
   "ownWrites": false,
   "tools": [
    {
     "name": "search",
     "summary": "Threads, newest first, across the owner's mail accounts, each with everyone on it but the owner; query takes the mail's own search words, such as in:sent; dates as YYYY-MM-DD. nextPage, passed as page, gives older threads",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "query": {
        "type": "string",
        "maxLength": 500
       },
       "from": {
        "type": "string",
        "maxLength": 200
       },
       "to": {
        "type": "string",
        "maxLength": 200
       },
       "after": {
        "type": "string",
        "maxLength": 40
       },
       "before": {
        "type": "string",
        "maxLength": 40
       },
       "hasAttachment": {
        "type": "boolean"
       },
       "source": {
        "description": "Only accounts whose name contains this, e.g. an email address",
        "type": "string",
        "maxLength": 120
       },
       "limit": {
        "default": 10,
        "type": "integer",
        "minimum": 1,
        "maximum": 20
       },
       "page": {
        "type": "string",
        "maxLength": 4000
       }
      }
     },
     "returns": "{\n  nextPage?: string;\n  hits: (Hit & {\n    source: string;\n  })[];\n  searched: string[];\n  failed: Failure[];\n}"
    },
    {
     "name": "read",
     "summary": "A thread's messages with sender, recipients, date and text, and its attachments. With an attachment's id, that file's text.",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "id": {
        "type": "string",
        "minLength": 3,
        "maxLength": 500
       },
       "attachment": {
        "type": "string",
        "maxLength": 300
       },
       "offset": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
       }
      },
      "required": [
       "id"
      ]
     },
     "returns": "Content & {\n  id: string;\n  source: string;\n  nextOffset?: number;\n}"
    },
    {
     "name": "draft",
     "summary": "Make a draft in the owner's Gmail, in its thread when replying. Sends nothing.",
     "kind": "create",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "to": {
        "default": [],
        "maxItems": 20,
        "type": "array",
        "items": {
         "type": "string",
         "maxLength": 200,
         "format": "email",
         "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
        }
       },
       "cc": {
        "maxItems": 20,
        "type": "array",
        "items": {
         "type": "string",
         "maxLength": 200,
         "format": "email",
         "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
        }
       },
       "subject": {
        "type": "string",
        "maxLength": 300
       },
       "text": {
        "type": "string",
        "maxLength": 20000
       },
       "threadId": {
        "description": "To reply in a thread: its id from search",
        "type": "string",
        "maxLength": 300
       },
       "replyAll": {
        "description": "Answer everyone on the thread",
        "type": "boolean"
       },
       "attach": {
        "description": "Drive files (Google files go as PDFs), attachments by their id from search, or workspace files by path, 25 MB in all",
        "maxItems": 10,
        "type": "array",
        "items": {
         "anyOf": [
          {
           "type": "object",
           "properties": {
            "file": {
             "type": "string",
             "minLength": 3,
             "maxLength": 500
            }
           },
           "required": [
            "file"
           ]
          },
          {
           "type": "object",
           "properties": {
            "email": {
             "type": "string",
             "minLength": 3,
             "maxLength": 500
            },
            "attachment": {
             "type": "string",
             "minLength": 3,
             "maxLength": 300
            }
           },
           "required": [
            "attachment"
           ]
          },
          {
           "type": "object",
           "properties": {
            "workspace": {
             "type": "string",
             "minLength": 1,
             "maxLength": 500
            }
           },
           "required": [
            "workspace"
           ]
          }
         ]
        }
       },
       "signature": {
        "description": "false leaves off the owner's Gmail signature",
        "type": "boolean"
       }
      },
      "required": [
       "subject",
       "text"
      ]
     },
     "returns": "{\n  draftId: string;\n  threadId: string;\n  to: string[];\n}"
    },
    {
     "name": "send",
     "summary": "Send an email from the owner's Gmail. It goes after a two-minute Undo.",
     "kind": "send",
     "checked": true,
     "note": true,
     "undo": true,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "to": {
        "default": [],
        "maxItems": 20,
        "type": "array",
        "items": {
         "type": "string",
         "maxLength": 200,
         "format": "email",
         "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
        }
       },
       "cc": {
        "maxItems": 20,
        "type": "array",
        "items": {
         "type": "string",
         "maxLength": 200,
         "format": "email",
         "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
        }
       },
       "subject": {
        "type": "string",
        "maxLength": 300
       },
       "text": {
        "type": "string",
        "minLength": 1,
        "maxLength": 20000
       },
       "threadId": {
        "description": "To reply in a thread: its id from search",
        "type": "string",
        "maxLength": 300
       },
       "replyAll": {
        "description": "Answer everyone on the thread",
        "type": "boolean"
       },
       "attach": {
        "description": "Drive files (Google files go as PDFs), attachments by their id from search, or workspace files by path, 25 MB in all",
        "maxItems": 10,
        "type": "array",
        "items": {
         "anyOf": [
          {
           "type": "object",
           "properties": {
            "file": {
             "type": "string",
             "minLength": 3,
             "maxLength": 500
            }
           },
           "required": [
            "file"
           ]
          },
          {
           "type": "object",
           "properties": {
            "email": {
             "type": "string",
             "minLength": 3,
             "maxLength": 500
            },
            "attachment": {
             "type": "string",
             "minLength": 3,
             "maxLength": 300
            }
           },
           "required": [
            "attachment"
           ]
          },
          {
           "type": "object",
           "properties": {
            "workspace": {
             "type": "string",
             "minLength": 1,
             "maxLength": 500
            }
           },
           "required": [
            "workspace"
           ]
          }
         ]
        }
       },
       "signature": {
        "description": "false leaves off the owner's Gmail signature",
        "type": "boolean"
       }
      },
      "required": [
       "subject",
       "text"
      ]
     },
     "returns": "{\n  held: {\n    trigger: number;\n    at: string;\n    to: string[];\n  };\n  threadId: string;\n  note: string;\n}"
    }
   ]
  },
  {
   "name": "calendar",
   "label": "Calendar",
   "about": "the owner's calendar: meetings and time held",
   "description": "The owner's own Google Calendar, read and written as them.",
   "research": false,
   "ownWrites": false,
   "tools": [
    {
     "name": "list",
     "summary": "Meetings between two times, soonest first, with guests",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "after": {
        "type": "string",
        "maxLength": 40
       },
       "before": {
        "type": "string",
        "maxLength": 40
       },
       "query": {
        "type": "string",
        "maxLength": 200
       },
       "limit": {
        "default": 20,
        "type": "integer",
        "minimum": 1,
        "maximum": 50
       }
      },
      "required": [
       "after",
       "before"
      ]
     },
     "returns": "{\n  id: string;\n  title: string;\n  start: string;\n  end: string;\n  guests: string[];\n  url: string;\n}[]"
    },
    {
     "name": "hold",
     "summary": "Hold time on the owner's own calendar; invites nobody",
     "kind": "create",
     "checked": false,
     "note": false,
     "undo": true,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "title": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
       },
       "start": {
        "type": "string",
        "maxLength": 40
       },
       "end": {
        "type": "string",
        "maxLength": 40
       },
       "note": {
        "type": "string",
        "maxLength": 2000
       }
      },
      "required": [
       "title",
       "start",
       "end"
      ]
     },
     "returns": "{\n  id: string;\n  url: string;\n}"
    }
   ]
  },
  {
   "name": "books",
   "label": "Books",
   "about": "invoices and what customers owe, from the owner's accounting app",
   "description": "The owner's own QuickBooks: invoices, what each customer owes and what was paid, read live as them. Amounts are in the invoice's currency.",
   "research": false,
   "ownWrites": false,
   "tools": [
    {
     "name": "invoices",
     "summary": "Invoices, newest first, with customer, email, total, balance and due date. status is \"open\" (money owed), \"overdue\" (owed past its due date) or \"paid\"; customer matches part of a name",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "status": {
        "type": "string",
        "enum": [
         "open",
         "overdue",
         "paid"
        ]
       },
       "customer": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
       },
       "limit": {
        "default": 20,
        "type": "integer",
        "minimum": 1,
        "maximum": 50
       }
      }
     },
     "returns": "{\n  invoices: {\n    url: string;\n    daysLate?: number;\n    id: string;\n    number: string | null;\n    customer: string | null;\n    email: string | null;\n    date: string | null;\n    due: string | null;\n    total: number;\n    balance: number;\n    currency: string | null;\n    status: string;\n  }[];\n  more: boolean;\n}"
    },
    {
     "name": "invoice",
     "summary": "One invoice's lines, amounts, tax, due date, customer email, whether it was emailed, and its link",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "id": {
        "type": "string",
        "maxLength": 30,
        "pattern": "^\\d+$"
       }
      },
      "required": [
       "id"
      ]
     },
     "returns": "{\n  tax: number;\n  memo: string | null;\n  emailed: boolean;\n  lines: {\n    unitPrice?: number;\n    quantity?: number;\n    item?: string;\n    description: string;\n    amount: number;\n  }[];\n  url: string;\n  daysLate?: number;\n  id: string;\n  number: string | null;\n  customer: string | null;\n  email: string | null;\n  date: string | null;\n  due: string | null;\n  total: number;\n  balance: number;\n  currency: string | null;\n  status: string;\n}"
    }
   ]
  },
  {
   "name": "workspace",
   "label": "Workspace",
   "about": "your own folder: files, spreadsheets and code",
   "description": "A small computer the owner's agents share, where files stay between runs: Python 3 with pandas, numpy, openpyxl, XlsxWriter, python-pptx, python-docx, pypdf and matplotlib, Node and a shell, and no internet. Runs start in your own folder; /work/inbox holds files opened from Drive and mail, and /work/shared is for what you leave another agent. Edit Office files here with code. Files leave through your other tools, which take a workspace path: files.save puts one in Drive, and mail's attach takes {workspace: path}. Code calls your other tools as `group.action(...)`, with the same input and checks: in Python, `from roadstar import mail`; in JavaScript, in a script in your folder, `import { mail } from \"roadstar\"` and await each call. A call the check holds back returns {not_done_yet} or {refused} and the code carries on; ask the owner in your reply once the run is done. A refused call raises ToolError. Write scripts to files and run them, such as `python report.py`, and write results to files from code: the shell can't pipe or redirect node's or python's output. Only a run's output reaches you, cut to 20,000 characters, so print what you need. Formulas are saved, not worked out: Excel and Sheets do that on open. A run stops after 120 s or 300 tool calls.",
   "research": false,
   "ownWrites": false,
   "tools": [
    {
     "name": "bash",
     "summary": "Run a shell command in your folder, such as `python report.py`: its output, exit code and the tools its code called",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "command": {
        "type": "string",
        "minLength": 1,
        "maxLength": 20000
       }
      },
      "required": [
       "command"
      ]
     },
     "returns": "{\n  calls: Record<string, number>;\n  tookMs: number;\n  usage: RunUsage;\n  stopped?: string;\n  exitCode: number | null;\n  output: string;\n}"
    },
    {
     "name": "read",
     "summary": "A text file's lines from offset (1 is the first), 2,000 at a time; nextOffset gives the rest. A binary file, such as .xlsx, gives its size: work on it with code",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "path": {
        "type": "string",
        "minLength": 1,
        "maxLength": 500
       },
       "offset": {
        "type": "integer",
        "minimum": 1,
        "maximum": 9007199254740991
       },
       "limit": {
        "type": "integer",
        "minimum": 1,
        "maximum": 2000
       }
      },
      "required": [
       "path"
      ]
     },
     "returns": "{\n  path: string;\n  text: string;\n  totalLines: number;\n  nextOffset: number | null;\n} | {\n  path: string;\n  binary: true;\n  size: number;\n}"
    },
    {
     "name": "write",
     "summary": "Write a text file, making its folders; replaces one that's there",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "path": {
        "type": "string",
        "minLength": 1,
        "maxLength": 500
       },
       "content": {
        "type": "string",
        "maxLength": 2000000
       }
      },
      "required": [
       "path",
       "content"
      ]
     },
     "returns": "{\n  path: string;\n  size: number;\n}"
    },
    {
     "name": "edit",
     "summary": "Replace exact text in a text file; oldText must appear once",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "path": {
        "type": "string",
        "minLength": 1,
        "maxLength": 500
       },
       "oldText": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200000
       },
       "newText": {
        "type": "string",
        "maxLength": 200000
       }
      },
      "required": [
       "path",
       "oldText",
       "newText"
      ]
     },
     "returns": "{\n  path: string;\n  size: number;\n}"
    },
    {
     "name": "open",
     "summary": "Copy Drive files and email attachments into /work/inbox. Google Sheets, Docs and Slides arrive as .xlsx, .docx and .pptx. Each file's path, and from: the Drive file it came from, for files.save's over",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "files": {
        "description": "Drive files: ids from search or the files tools, or links",
        "maxItems": 20,
        "type": "array",
        "items": {
         "type": "string",
         "minLength": 3,
         "maxLength": 500
        }
       },
       "attachments": {
        "description": "An attachment's id from search; for mail not in search, the thread's id from mail search and the id mail read listed",
        "maxItems": 20,
        "type": "array",
        "items": {
         "type": "object",
         "properties": {
          "email": {
           "type": "string",
           "minLength": 3,
           "maxLength": 500
          },
          "attachment": {
           "type": "string",
           "minLength": 3,
           "maxLength": 300
          }
         },
         "required": [
          "attachment"
         ]
        }
       }
      }
     },
     "returns": "{\n  opened: Record<string, unknown>[];\n}"
    }
   ]
  },
  {
   "name": "templates",
   "label": "Templates",
   "about": "agents, teams, departments and skills shared in the workspace",
   "description": "Setups someone already made: an agent, a team, a department or a skill. Search before making an agent. To suggest one, find what answers you can, say where, and propose_add; the owner adds it. propose_share when the owner asks to share. Never add or share yourself.",
   "research": false,
   "ownWrites": false,
   "tools": [
    {
     "name": "search",
     "summary": "Templates matching words, best first, each with what matched",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "query": {
        "type": "string",
        "minLength": 1,
        "maxLength": 120
       }
      },
      "required": [
       "query"
      ]
     },
     "returns": "{\n  id: string;\n  name: string;\n  kind: TemplateKind;\n  says: string;\n  from: string;\n  matched: string;\n}[]"
    },
    {
     "name": "read",
     "summary": "One template in full: its agents, skills, routines and questions",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "id": {
        "type": "string",
        "minLength": 1,
        "maxLength": 120
       }
      },
      "required": [
       "id"
      ]
     },
     "returns": "{\n  youHave: string[];\n  questions: {\n    blank: string;\n    asks: string;\n    kind: FillKind;\n  }[];\n  skill?: {\n    name: string;\n    when: string;\n    steps: string;\n  };\n  agents: {\n    skills: string[];\n    routines: string[];\n    under?: string;\n    name: string;\n    job: string;\n  }[];\n  department?: string;\n  id: string;\n  name: string;\n  kind: TemplateKind;\n  says: string;\n  version: number;\n}"
    },
    {
     "name": "propose_add",
     "summary": "Ask the owner to add one, with the answers you found and where",
     "kind": "create",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "id": {
        "type": "string",
        "minLength": 1,
        "maxLength": 120
       },
       "answers": {
        "type": "object",
        "propertyNames": {
         "type": "string"
        },
        "additionalProperties": {
         "type": "object",
         "properties": {
          "text": {
           "type": "string",
           "minLength": 1,
           "maxLength": 300
          },
          "link": {
           "type": "string",
           "maxLength": 500
          },
          "email": {
           "type": "string",
           "maxLength": 200
          },
          "found": {
           "type": "string",
           "maxLength": 80
          }
         },
         "required": [
          "text"
         ]
        }
       },
       "under": {
        "description": "One of the owner's agents its top agents report to",
        "type": "string",
        "maxLength": 60
       },
       "to": {
        "description": "For a skill: the agent that gets it",
        "type": "string",
        "maxLength": 60
       },
       "why": {
        "type": "string",
        "minLength": 1,
        "maxLength": 400,
        "description": "Why it fits, in a line or two the owner reads"
       }
      },
      "required": [
       "id",
       "why"
      ]
     },
     "returns": "{\n  asked: string;\n}"
    },
    {
     "name": "propose_share",
     "summary": "Ask the owner to share some of their agents, or one skill, as a template",
     "kind": "create",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "agents": {
        "description": "The agents by name",
        "maxItems": 16,
        "type": "array",
        "items": {
         "type": "string",
         "minLength": 1,
         "maxLength": 60
        }
       },
       "skill": {
        "type": "object",
        "properties": {
         "agent": {
          "type": "string",
          "maxLength": 60
         },
         "name": {
          "type": "string",
          "maxLength": 60
         }
        },
        "required": [
         "agent",
         "name"
        ]
       },
       "why": {
        "type": "string",
        "minLength": 1,
        "maxLength": 400
       }
      },
      "required": [
       "why"
      ]
     },
     "returns": "{\n  asked: string;\n}"
    }
   ]
  },
  {
   "name": "help",
   "label": "Help",
   "about": "these docs: how Roadstar works, and every tool",
   "description": "Roadstar's docs, as markdown: how agents, threads, hand-offs, routines and the owner's yes work, every tool with its input, result and limits, and worked examples. Search with the words you'd expect on the page, such as a tool's name; then read the page, or just the part you need.",
   "research": false,
   "ownWrites": false,
   "tools": [
    {
     "name": "search",
     "summary": "The pages and parts of pages with the most of these words, best first, each with its address and opening lines",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "query": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
       },
       "limit": {
        "type": "integer",
        "minimum": 1,
        "maximum": 20
       }
      },
      "required": [
       "query"
      ]
     },
     "returns": "{\n  total: number;\n  results: {\n    page: string;\n    title: string;\n    opens: string;\n  }[];\n}"
    },
    {
     "name": "read",
     "summary": "One page as markdown, by its address from search or a link, such as \"/tools/mail/\"; with #part, only that part, such as \"/tools/mail/#send\"",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "page": {
        "type": "string",
        "minLength": 1,
        "maxLength": 300
       }
      },
      "required": [
       "page"
      ]
     },
     "returns": "{\n  page: string;\n  title: string;\n  text: string;\n}"
    }
   ]
  },
  {
   "name": "search",
   "label": "Search",
   "about": "Search",
   "description": "Search and read the owner's mail, files and meetings as copied for Roadstar, and the workspace's own content. In search: the workspace's docs, tables, contacts and projects. Search is literal and fast and costs the owner's accounts nothing: search several times, with words in query and people, dates, folders, labels, sent or received as fields; identifiers as written. Totals and counts are exact over every match: counts.people shows who the owner writes with most. Results are one per thread; thread: its id lists every message. Read before you answer.",
   "research": false,
   "ownWrites": false,
   "tools": [
    {
     "name": "search",
     "summary": "One list with the exact total, how names and dates were understood, counts by type, source, year, direction and sender, each source's state, and next for the following page. Results with related: true matched by meaning, not by the words",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "query": {
        "description": "Words; \"PO 4471\", an invoice number or an email address match exactly",
        "type": "string",
        "maxLength": 300
       },
       "from": {
        "description": "Sender, author or organizer: names, addresses or a company",
        "maxItems": 10,
        "type": "array",
        "items": {
         "type": "string",
         "minLength": 1,
         "maxLength": 200
        }
       },
       "to": {
        "description": "To, cc or guests",
        "maxItems": 10,
        "type": "array",
        "items": {
         "type": "string",
         "minLength": 1,
         "maxLength": 200
        }
       },
       "with": {
        "description": "Anyone on it, or everyone at a company",
        "maxItems": 10,
        "type": "array",
        "items": {
         "type": "string",
         "minLength": 1,
         "maxLength": 200
        }
       },
       "after": {
        "description": "\"2026-09-01\" or \"last week\"",
        "type": "string",
        "maxLength": 40
       },
       "before": {
        "type": "string",
        "maxLength": 40
       },
       "type": {
        "maxItems": 8,
        "type": "array",
        "items": {
         "type": "string",
         "enum": [
          "email",
          "doc",
          "sheet",
          "slides",
          "pdf",
          "image",
          "file",
          "meeting",
          "page",
          "table",
          "contact",
          "project"
         ]
        }
       },
       "in": {
        "description": "A folder (\"Clients › Juniper Dental\") or a mail label (\"label:Clients\", \"label:STARRED\")",
        "maxItems": 5,
        "type": "array",
        "items": {
         "type": "string",
         "minLength": 1,
         "maxLength": 200
        }
       },
       "has": {
        "maxItems": 2,
        "type": "array",
        "items": {
         "type": "string",
         "enum": [
          "attachment",
          "star"
         ]
        }
       },
       "dir": {
        "description": "Mail the owner sent, or mail they received",
        "type": "string",
        "enum": [
         "sent",
         "received"
        ]
       },
       "bulk": {
        "description": "false: mail from people only; true: newsletters and automated mail only",
        "type": "boolean"
       },
       "waiting": {
        "description": "Threads where a person wrote last and the owner hasn't answered (me), or the reverse",
        "type": "string",
        "enum": [
         "me",
         "them"
        ]
       },
       "thread": {
        "description": "Every message of one thread, by its thread id",
        "type": "string",
        "maxLength": 200
       },
       "sort": {
        "type": "string",
        "enum": [
         "relevance",
         "newest",
         "oldest"
        ]
       },
       "limit": {
        "default": 10,
        "type": "integer",
        "minimum": 1,
        "maximum": 50
       },
       "cursor": {
        "type": "string",
        "maxLength": 400
       }
      }
     },
     "returns": "{\n  hint?: string;\n  results: {\n    addedBy?: string;\n    related?: boolean;\n    text?: string;\n    moreInThread?: number;\n    thread?: string;\n    money?: string[];\n    attachments?: string;\n    where: string;\n    match: string;\n    dir?: string;\n    to?: string;\n    from?: string;\n    id: string;\n    type: string;\n    title: string;\n    date: string;\n  }[];\n  counts: {\n    type: Record<string, number>;\n    source: Record<string, number>;\n    year: Record<string, number>;\n    dir: Record<string, number>;\n    people: Record<string, number>;\n  };\n  sources: Record<string, string>;\n  next: string | null;\n  understood?: Record<string, string>;\n  words?: string;\n  related?: number;\n  total: string | number;\n}"
    },
    {
     "name": "read",
     "summary": "A result in full, 30,000 characters at a time: a message with sender, recipients, date and its attachments' ids; a whole thread by an id gmail:{account}:t:{thread}; an attachment's or file's text; a meeting. With next, read again from that offset",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "id": {
        "type": "string",
        "minLength": 3,
        "maxLength": 500
       },
       "offset": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
       }
      },
      "required": [
       "id"
      ]
     },
     "returns": "ItemRead"
    }
   ]
  },
  {
   "name": "integrations",
   "label": "Integrations",
   "about": "the apps the owner has connected or could connect",
   "description": "The owner's connected apps and the ones they could connect. When work needs an app that isn't connected, offer the card with connect, saying in a line what it lets you do.",
   "research": false,
   "ownWrites": false,
   "tools": [
    {
     "name": "list",
     "summary": "The apps connected now, the ones the owner could connect, and those not ready yet",
     "kind": "read",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": false,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {}
     },
     "returns": "{\n  apps: {\n    name: string;\n    app: string;\n    tools: number;\n  }[];\n  connected: {\n    status?: \"needs_reconnect\" | \"removing\" | \"removed\";\n    integration: string;\n    account: string | null;\n  }[];\n  canConnect: {\n    integration: string;\n    app: string;\n  }[];\n  notYet: string[];\n}"
    },
    {
     "name": "connect",
     "summary": "Offer the owner a card that connects an app, by its key from list",
     "kind": "create",
     "checked": false,
     "note": false,
     "undo": false,
     "quiet": true,
     "input": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "integration": {
        "type": "string",
        "minLength": 1,
        "maxLength": 100
       },
       "why": {
        "description": "One line to the owner",
        "type": "string",
        "maxLength": 200
       }
      },
      "required": [
       "integration"
      ]
     },
     "returns": "{\n  error: string;\n  message: string;\n  notYet?: never;\n  card?: never;\n} | {\n  notYet: string;\n  error?: never;\n  message?: never;\n  card?: never;\n} | {\n  card: string;\n  error?: never;\n  message?: never;\n  notYet?: never;\n}"
    }
   ]
  }
 ],
 "agentTools": [
  {
   "name": "browse_tools",
   "label": "Browsed tools",
   "description": "Every tool you have is in one of these groups. Browse up to 3 to see their tools, then load the ones you need with find_tools.\n- contacts: the people the business deals with (11)\n- companies: the businesses the owner deals with: clients, suppliers, their conversations (11)\n- web: search the web and read pages (2)\n- pages: research pages (6)\n- comments: comments on pages (2)\n- projects: projects that hold docs, pages and tables (4)\n- tables: research tables (6)\n- filings: public companies' filings (2)\n- newsfeed: today's news (1)\n- docs: the business's docs: proposals, briefs, checklists (5)\n- files: the owner's Drive: files, Google Docs and Sheets (15)\n- mail: the owner's Gmail (4)\n- calendar: the owner's calendar: meetings and time held (2)\n- books: invoices and what customers owe, from the owner's accounting app (2)\n- workspace: your own folder: files, spreadsheets and code (5)\n- templates: agents, teams, departments and skills shared in the workspace (4)\n- help: these docs: how Roadstar works, and every tool (2)\n- search: Search (2)\n- integrations: the apps the owner has connected or could connect (2)",
   "input": {
    "type": "object",
    "required": [
     "groups"
    ],
    "properties": {
     "groups": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "Group names from the list"
     }
    }
   },
   "offered": [
    "thread",
    "computer"
   ]
  },
  {
   "name": "find_tools",
   "label": "Found tools",
   "description": "Load tools by name, as browse_tools lists them, such as \"mail.send\": each with its input and how to use its group well. Up to 8 at once.",
   "input": {
    "type": "object",
    "required": [
     "names"
    ],
    "properties": {
     "names": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "Tool names, such as \"contacts.update\""
     }
    }
   },
   "offered": [
    "thread",
    "computer"
   ]
  },
  {
   "name": "use_tool",
   "label": "Used",
   "description": "Run one tool by its name, with its input. One that sends outside the business, deletes, or changes what's there is checked first.",
   "input": {
    "type": "object",
    "required": [
     "name"
    ],
    "properties": {
     "name": {
      "type": "string",
      "description": "The tool's name, such as \"mail.send\""
     },
     "input": {
      "type": "object",
      "patternProperties": {
       "^.*$": {}
      }
     }
    }
   },
   "offered": [
    "thread",
    "computer"
   ]
  },
  {
   "name": "hand_off",
   "label": "Hand off",
   "description": "Give work to another of the owner's agents, by name: the task, notes and links to what it needs. It hasn't seen your chat. Its answer comes back to you; don't wait for it.",
   "input": {
    "type": "object",
    "required": [
     "agent",
     "task"
    ],
    "properties": {
     "agent": {
      "type": "string",
      "description": "The agent, by name"
     },
     "task": {
      "type": "string",
      "description": "What to do, in a sentence or two"
     },
     "notes": {
      "type": "string",
      "description": "Facts it needs that no link holds: names, dates, choices"
     },
     "links": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "What to read, as mail:, file:, contact:, doc: or web: with the id or address a tool gave you"
     },
     "answer": {
      "anyOf": [
       {
        "type": "string",
        "const": "me"
       },
       {
        "type": "string",
        "const": "whoever asked me"
       }
      ],
      "description": "You by default; whoever asked you, when you pass their work on whole"
     }
    }
   },
   "offered": [
    "roadstar",
    "chat",
    "thread",
    "computer"
   ]
  },
  {
   "name": "remember",
   "label": "Notes",
   "description": "Keep a short note on how the owner likes your work done, when they say remember or agree to one. Your threads read it too.",
   "input": {
    "type": "object",
    "properties": {
     "note": {
      "type": "string"
     },
     "forget": {
      "type": "string",
      "description": "A note to drop, word for word"
     },
     "about": {
      "type": "string",
      "description": "What every agent should know about the owner and the business (what it does, its site, customers, prices, voice), given whole, rewritten with what you learned"
     }
    }
   },
   "offered": [
    "roadstar",
    "chat",
    "thread",
    "computer"
   ]
  },
  {
   "name": "make_agent",
   "label": "New agent",
   "description": "Make one agent for a lasting job, from a short job description. Then hand it the work that led to it with hand_off.",
   "input": {
    "type": "object",
    "required": [
     "name",
     "job",
     "owns",
     "good",
     "works",
     "asksFirst"
    ],
    "properties": {
     "name": {
      "type": "string"
     },
     "job": {
      "type": "string",
      "description": "Its job in one line"
     },
     "owns": {
      "type": "string",
      "description": "What it owns, in a line or two"
     },
     "good": {
      "type": "string",
      "description": "What good looks like"
     },
     "works": {
      "type": "string",
      "description": "When it works: as mail arrives, Fridays at 4 PM"
     },
     "asksFirst": {
      "type": "string",
      "description": "What it asks the owner before doing"
     },
     "model": {
      "anyOf": [
       {
        "type": "string",
        "const": "gpt-6-luna"
       },
       {
        "type": "string",
        "const": "gpt-6.1-terra"
       },
       {
        "type": "string",
        "const": "gpt-6.1-sol"
       },
       {
        "type": "string",
        "const": "gpt-6-astra"
       }
      ],
      "description": "Leave it out for the default. Luna is cheapest, for simple repeated work; Sol and Astra cost 2× and 10×, for harder judgement"
     },
     "reportsTo": {
      "type": "string",
      "description": "Who it sits under on the chart, by name; Roadstar if none"
     },
     "department": {
      "type": "string",
      "description": "Its department on the chart"
     }
    }
   },
   "offered": [
    "roadstar"
   ]
  },
  {
   "name": "change_agent",
   "label": "Changed",
   "description": "Change an agent: its name, job, description, model, or where it sits on the chart.",
   "input": {
    "type": "object",
    "required": [
     "agent"
    ],
    "properties": {
     "agent": {
      "type": "string",
      "description": "The agent, by name"
     },
     "name": {
      "type": "string"
     },
     "job": {
      "type": "string"
     },
     "owns": {
      "type": "string",
      "description": "What it owns, in a line or two"
     },
     "good": {
      "type": "string",
      "description": "What good looks like"
     },
     "works": {
      "type": "string",
      "description": "When it works: as mail arrives, Fridays at 4 PM"
     },
     "asksFirst": {
      "type": "string",
      "description": "What it asks the owner before doing"
     },
     "model": {
      "anyOf": [
       {
        "type": "string",
        "const": "gpt-6-luna"
       },
       {
        "type": "string",
        "const": "gpt-6.1-terra"
       },
       {
        "type": "string",
        "const": "gpt-6.1-sol"
       },
       {
        "type": "string",
        "const": "gpt-6-astra"
       }
      ],
      "description": "Leave it out for the default. Luna is cheapest, for simple repeated work; Sol and Astra cost 2× and 10×, for harder judgement"
     },
     "reportsTo": {
      "type": "string",
      "description": "Who it sits under, by name"
     },
     "department": {
      "type": "string"
     }
    }
   },
   "offered": [
    "roadstar"
   ]
  },
  {
   "name": "start_thread",
   "label": "New thread",
   "description": "Start a thread for work no thread holds: one per client, project or job. Fresh starts empty with the packet; fork starts from this chat's memory. Its answer comes back on its own.",
   "input": {
    "type": "object",
    "required": [
     "title",
     "task"
    ],
    "properties": {
     "title": {
      "type": "string",
      "description": "What it's about, in a few words: Juniper Dental"
     },
     "kind": {
      "anyOf": [
       {
        "type": "string",
        "const": "fresh"
       },
       {
        "type": "string",
        "const": "fork"
       }
      ],
      "description": "fresh unless the work needs this conversation"
     },
     "task": {
      "type": "string",
      "description": "What to do, in a sentence or two"
     },
     "notes": {
      "type": "string",
      "description": "Facts it needs that no link holds: names, dates, choices"
     },
     "links": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "What to read, as mail:, file:, contact:, doc: or web: with the id or address a tool gave you"
     },
     "andThen": {
      "type": "string",
      "description": "When you start several threads and write one answer from all of them: what to do once the last answers"
     }
    }
   },
   "offered": [
    "roadstar",
    "chat"
   ]
  },
  {
   "name": "message_thread",
   "label": "Sent to thread",
   "description": "Send a thread more work or a correction. A running thread takes it at its next step; an idle or stopped one starts on it, with all it did before.",
   "input": {
    "type": "object",
    "required": [
     "thread",
     "task"
    ],
    "properties": {
     "thread": {
      "type": "string",
      "description": "The thread, by title"
     },
     "task": {
      "type": "string",
      "description": "What to do, in a sentence or two"
     },
     "notes": {
      "type": "string",
      "description": "Facts it needs that no link holds: names, dates, choices"
     },
     "links": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "What to read, as mail:, file:, contact:, doc: or web: with the id or address a tool gave you"
     }
    }
   },
   "offered": [
    "roadstar",
    "chat"
   ]
  },
  {
   "name": "read_thread",
   "label": "Read thread",
   "description": "Read what a thread did: its memory from the top, or with id a line or message of it, down to the exact words.",
   "input": {
    "type": "object",
    "required": [
     "thread"
    ],
    "properties": {
     "thread": {
      "type": "string",
      "description": "The thread, by title"
     },
     "id": {
      "type": "integer",
      "minimum": 0,
      "description": "A line's or message's id"
     },
     "n": {
      "type": "integer",
      "minimum": 1,
      "description": "The line's n; 1 for a message"
     },
     "page": {
      "type": "integer",
      "minimum": 0,
      "description": "Where in a long message"
     }
    }
   },
   "offered": [
    "roadstar",
    "chat"
   ]
  },
  {
   "name": "close_thread",
   "label": "Closed",
   "description": "Close a thread whose work is over: a finished project or a one-off job. It stays readable, and a message reopens it.",
   "input": {
    "type": "object",
    "required": [
     "thread"
    ],
    "properties": {
     "thread": {
      "type": "string",
      "description": "The thread, by title"
     }
    }
   },
   "offered": [
    "roadstar",
    "chat"
   ]
  },
  {
   "name": "skills",
   "label": "Skills",
   "description": "List, read, add or change an agent's skills: step-by-step how-tos for one kind of work, such as \"Onboard a client\". A skill never widens what the agent may do.",
   "input": {
    "type": "object",
    "required": [
     "action"
    ],
    "properties": {
     "action": {
      "anyOf": [
       {
        "type": "string",
        "const": "list"
       },
       {
        "type": "string",
        "const": "read"
       },
       {
        "type": "string",
        "const": "add"
       },
       {
        "type": "string",
        "const": "change"
       }
      ]
     },
     "agent": {
      "type": "string",
      "description": "The agent, by name; you by default"
     },
     "id": {
      "type": "string",
      "description": "The skill, from list"
     },
     "name": {
      "type": "string"
     },
     "about": {
      "type": "string",
      "description": "When it applies, in one line"
     },
     "steps": {
      "type": "string"
     },
     "why": {
      "type": "string",
      "description": "For a change: why, in a line the owner reads"
     }
    }
   },
   "offered": [
    "roadstar",
    "chat",
    "thread",
    "computer"
   ]
  },
  {
   "name": "triggers",
   "label": "Routines",
   "description": "When an agent works on its own: on a schedule, or when something happens, such as new mail. One that keeps going is a routine.",
   "input": {
    "type": "object",
    "required": [
     "action"
    ],
    "properties": {
     "action": {
      "anyOf": [
       {
        "type": "string",
        "const": "list"
       },
       {
        "type": "string",
        "const": "add"
       },
       {
        "type": "string",
        "const": "off"
       },
       {
        "type": "string",
        "const": "on"
       },
       {
        "type": "string",
        "const": "change"
       }
      ]
     },
     "agent": {
      "type": "string",
      "description": "The agent, by name; you by default"
     },
     "id": {
      "type": "number",
      "description": "The routine's number, from list"
     },
     "name": {
      "type": "string"
     },
     "skill": {
      "type": "string",
      "description": "One of the agent's skills to run"
     },
     "note": {
      "type": "string",
      "description": "What to do when it fires"
     },
     "when": {
      "type": "object",
      "properties": {
       "keys": {
        "type": "array",
        "items": {
         "type": "string"
        },
        "description": "Any of these fires it: kind:<event> (kind:invoice.overdue, kind:meeting.added, kind:doc.changed, kind:form.submitted), thread:<connection>:<threadId>, from:<email>, domain:<domain>, with:<email>, doc:<connection>:<fileId>, invoice:qb:<id>, customer:qb:<id>"
       },
       "ask": {
        "type": "string",
        "description": "Words checked against each new email and document of the owner's, such as \"a new client asking about a project\""
       },
       "at": {
        "type": "string",
        "description": "A cron line in the owner's time zone: \"30 7 * * 1-5\" is weekdays 7:30"
       },
       "due": {
        "type": "string",
        "description": "A one-off time, ISO 8601, such as a wait's deadline"
       },
       "check": {
        "type": "object",
        "required": [
         "tool",
         "action",
         "everyMinutes"
        ],
        "properties": {
         "tool": {
          "type": "string"
         },
         "action": {
          "type": "string"
         },
         "input": {
          "type": "object",
          "patternProperties": {
           "^.*$": {}
          }
         },
         "everyMinutes": {
          "type": "number",
          "minimum": 15
         }
        }
       }
      },
      "description": "When it fires: keys, words, a cron time, a due time, or a check"
     },
     "filter": {
      "type": "object",
      "patternProperties": {
       "^.*$": {}
      },
      "description": "Checks on the event, such as {withGuests: true}"
     },
     "once": {
      "type": "boolean",
      "description": "Fires once, such as a nudge on Monday if a thread has no reply"
     }
    }
   },
   "offered": [
    "roadstar",
    "chat"
   ]
  },
  {
   "name": "zoom_memory",
   "label": "Memory",
   "description": "Open line id+n of your memory into the two lines it was made from (n a power of 2, id a multiple of n), or with n = 1 read message id whole; a long one a page at a time from at.",
   "input": {
    "type": "object",
    "required": [
     "id"
    ],
    "properties": {
     "id": {
      "type": "integer",
      "description": "The line's first message"
     },
     "n": {
      "type": "integer",
      "description": "How many messages the line covers; 1 for a message"
     },
     "at": {
      "type": "integer",
      "description": "Where to go on in a long message"
     }
    }
   },
   "offered": [
    "roadstar",
    "chat",
    "thread"
   ]
  },
  {
   "name": "message_date",
   "label": "Memory",
   "description": "The date and time of message id.",
   "input": {
    "type": "object",
    "required": [
     "id"
    ],
    "properties": {
     "id": {
      "type": "integer",
      "description": "The message's id"
     }
    }
   },
   "offered": [
    "roadstar",
    "chat",
    "thread"
   ]
  }
 ],
 "limits": {
  "chatSteps": 4,
  "threadSteps": 40,
  "browsed": 3,
  "loaded": 8,
  "openThreads": 30,
  "running": {
   "agent": 3,
   "person": 8
  },
  "readThread": 32000,
  "packet": {
   "task": 600,
   "notes": 2000,
   "links": 20
  },
  "linkKinds": [
   "mail",
   "file",
   "contact",
   "doc",
   "web"
  ],
  "handOffDepth": 3,
  "agents": 40,
  "jobDescription": 600,
  "retries": 5
 },
 "models": {
  "list": [
   {
    "id": "gpt-6-luna",
    "label": "GPT-6 Luna",
    "use": "a tenth of Terra's price, for simple, repetitive work",
    "usd": {
     "input": 0.1,
     "cachedInput": 0.01,
     "cacheWrite": 0.125,
     "output": 0.5
    }
   },
   {
    "id": "gpt-6.1-terra",
    "label": "GPT-6.1 Terra",
    "use": "the default",
    "usd": {
     "input": 1,
     "cachedInput": 0.05,
     "cacheWrite": 1.25,
     "output": 5
    }
   },
   {
    "id": "gpt-6.1-sol",
    "label": "GPT-6.1 Sol",
    "use": "twice Terra's price, for harder judgement",
    "usd": {
     "input": 2,
     "cachedInput": 0.1,
     "cacheWrite": 2.5,
     "output": 10
    }
   },
   {
    "id": "gpt-6-astra",
    "label": "GPT-6 Astra",
    "use": "ten times Terra's price, for the hardest work",
    "usd": {
     "input": 10,
     "cachedInput": 1,
     "cacheWrite": 12.5,
     "output": 50
    }
   }
  ],
  "default": "gpt-6.1-terra",
  "thinking": [
   "low",
   "medium",
   "high"
  ],
  "defaultThinking": "medium"
 },
 "errorKinds": [
  "not_connected",
  "reauth",
  "forbidden",
  "not_found",
  "rate_limited",
  "unavailable",
  "too_large",
  "unsupported",
  "bad_input",
  "vendor",
  "changed",
  "unknown_outcome"
 ]
}
