Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
feat(ai): split unified search tool into content + name search (#773)
Eric Hayes5c8d3810d410
diff --git a/js/app/justfile b/js/app/justfileindex 1bf152ec9f..f8ad70bc21 100644--- a/js/app/justfile+++ b/js/app/justfile@@ -53,6 +53,9 @@ gen-api:gen-dcs-types:bun scripts/generate-dcs-types.ts+gen-dcs-types-local:+ MODE=local bun scripts/generate-dcs-types.ts+gen-dcs-tools:bun scripts/generate-dcs-tools.tsdiff --git a/js/app/packages/core/component/AI/component/tool/UnifiedSearch.tsx b/js/app/packages/core/component/AI/component/tool/Search.tsxsimilarity index 88%rename from js/app/packages/core/component/AI/component/tool/UnifiedSearch.tsxrename to js/app/packages/core/component/AI/component/tool/Search.tsxindex 14a9bd669d..018e102beb 100644--- a/js/app/packages/core/component/AI/component/tool/UnifiedSearch.tsx+++ b/js/app/packages/core/component/AI/component/tool/Search.tsx@@ -13,9 +13,9 @@ import { BaseTool } from './BaseTool';import { createToolRenderer } from './ToolRenderer';type UnifiedSearchResult = NamedTool<- 'UnifiedSearch',+ 'NameSearch','response'->['data']['response']['results'][number];+>['data']['results'][number];const UnifiedSearchToolResponse = (props: {results: UnifiedSearchResult[];@@ -169,26 +169,28 @@ const UnifiedSearchToolResponse = (props: {);};-const handler = createToolRenderer({- name: 'UnifiedSearch',- renderCall: (ctx) => (- <BaseTool- icon={MagnifyingGlass}- text="Searching..."- renderContext={ctx.renderContext}- type="call"- />- ),- renderResponse: (ctx) => (- <BaseTool- icon={MagnifyingGlass}- text="Found"- renderContext={ctx.renderContext}- type="response"- >- <UnifiedSearchToolResponse results={ctx.tool.data.response.results} />- </BaseTool>- ),-});+const createHandler = (name: 'NameSearch' | 'ContentSearch') =>+ createToolRenderer({+ name,+ renderCall: (ctx) => (+ <BaseTool+ icon={MagnifyingGlass}+ text="Searching..."+ renderContext={ctx.renderContext}+ type="call"+ />+ ),+ renderResponse: (ctx) => (+ <BaseTool+ icon={MagnifyingGlass}+ text="Found"+ renderContext={ctx.renderContext}+ type="response"+ >+ <UnifiedSearchToolResponse results={ctx.tool.data.results} />+ </BaseTool>+ ),+ });-export const unifiedSearchHandler = handler;+export const nameSearchHandler = createHandler('NameSearch');+export const contentSearchHandler = createHandler('ContentSearch');diff --git a/js/app/packages/core/component/AI/component/tool/handler.tsx b/js/app/packages/core/component/AI/component/tool/handler.tsxindex d2647e3c35..54284bc90c 100644--- a/js/app/packages/core/component/AI/component/tool/handler.tsx+++ b/js/app/packages/core/component/AI/component/tool/handler.tsx@@ -14,8 +14,8 @@ import { listDocumentsHandler } from './ListDocuments';import { listEmailsHandler } from './ListEmails';import { rewriteHandler } from './MarkdownRewrite';import { readHandler } from './Read';+import { contentSearchHandler, nameSearchHandler } from './Search';import type { RenderContext } from './ToolRenderer';-import { unifiedSearchHandler } from './UnifiedSearch';import { webSearchHandler } from './WebSearch';const [renderStore, setRenderStore] = createStore<@@ -23,7 +23,8 @@ const [renderStore, setRenderStore] = createStore<>({});const toolHandlers: ToolHandlerMap<RenderContext> = {- UnifiedSearch: unifiedSearchHandler,+ ContentSearch: contentSearchHandler,+ NameSearch: nameSearchHandler,web_search: webSearchHandler,MarkdownRewrite: rewriteHandler,Read: readHandler,diff --git a/js/app/packages/service-clients/service-cognition/generated/tools/schemas.ts b/js/app/packages/service-clients/service-cognition/generated/tools/schemas.tsindex 7eb5be1dce..c27a871ef3 100644--- a/js/app/packages/service-clients/service-cognition/generated/tools/schemas.ts+++ b/js/app/packages/service-clients/service-cognition/generated/tools/schemas.ts@@ -4,6 +4,30 @@*/import { z } from 'zod';+export const ContentSearch = z.object({ "entityTypes": z.array(z.enum(["documents","chats","emails","channels","projects"])).default([]), "query": z.string() }).strict()+++export const SearchToolResponse = z.object({ "results": z.array(z.any().superRefine((x, ctx) => {+ const schemas = [z.object({ "document_id": z.string().uuid(), "document_name": z.string(), "document_search_results": z.array(z.object({ "highlight": z.object({ "bcc": z.array(z.string()).optional(), "cc": z.array(z.string()).optional(), "content": z.array(z.string()).optional(), "name": z.union([z.string(), z.null()]).optional(), "recipients": z.array(z.string()).optional(), "sender": z.union([z.string(), z.null()]).optional(), "user_id": z.union([z.string(), z.null()]).optional() }), "node_id": z.union([z.string(), z.null()]).optional(), "raw_content": z.union([z.string(), z.null()]).optional(), "score": z.union([z.number(), z.null()]).optional() })), "file_type": z.union([z.string(), z.null()]).optional(), "id": z.string().uuid(), "metadata": z.union([z.object({ "created_at": z.number().int(), "deleted_at": z.union([z.number().int(), z.null()]).optional(), "project_id": z.union([z.string(), z.null()]).optional(), "updated_at": z.number().int(), "viewed_at": z.union([z.number().int(), z.null()]).optional() }), z.null()]).optional(), "name": z.string(), "owner_id": z.string(), "sub_type": z.union([z.literal("task"), z.null()]).optional(), "type": z.literal("document") }), z.object({ "chat_id": z.string().uuid(), "chat_search_results": z.array(z.object({ "chat_message_id": z.union([z.string().uuid(), z.null()]).optional(), "highlight": z.object({ "bcc": z.array(z.string()).optional(), "cc": z.array(z.string()).optional(), "content": z.array(z.string()).optional(), "name": z.union([z.string(), z.null()]).optional(), "recipients": z.array(z.string()).optional(), "sender": z.union([z.string(), z.null()]).optional(), "user_id": z.union([z.string(), z.null()]).optional() }), "role": z.union([z.string(), z.null()]).optional(), "score": z.union([z.number(), z.null()]).optional() })), "id": z.string().uuid(), "metadata": z.union([z.object({ "created_at": z.number().int(), "deleted_at": z.union([z.number().int(), z.null()]).optional(), "project_id": z.union([z.string(), z.null()]).optional(), "updated_at": z.number().int(), "viewed_at": z.union([z.number().int(), z.null()]).optional() }), z.null()]).optional(), "name": z.string(), "owner_id": z.string(), "type": z.literal("chat"), "user_id": z.string() }), z.object({ "created_at": z.number().int(), "email_message_search_results": z.array(z.object({ "bcc": z.array(z.string()), "cc": z.array(z.string()), "highlight": z.object({ "bcc": z.array(z.string()).optional(), "cc": z.array(z.string()).optional(), "content": z.array(z.string()).optional(), "name": z.union([z.string(), z.null()]).optional(), "recipients": z.array(z.string()).optional(), "sender": z.union([z.string(), z.null()]).optional(), "user_id": z.union([z.string(), z.null()]).optional() }), "labels": z.array(z.string()), "message_id": z.union([z.string().uuid(), z.null()]).optional(), "pretty_sender": z.string(), "recipients": z.array(z.string()), "score": z.union([z.number(), z.null()]).optional(), "sender": z.string(), "sent_at": z.union([z.number().int(), z.null()]).optional() })), "id": z.string().uuid(), "name": z.union([z.string(), z.null()]).optional(), "owner_id": z.string(), "snippet": z.union([z.string(), z.null()]).optional(), "subject": z.union([z.string(), z.null()]).optional(), "thread_id": z.string().uuid(), "type": z.literal("email"), "updated_at": z.number().int(), "user_id": z.string(), "viewed_at": z.union([z.number().int(), z.null()]).optional() }), z.object({ "channel_id": z.string().uuid(), "channel_message_search_results": z.array(z.object({ "created_at": z.union([z.number().int(), z.null()]).optional(), "highlight": z.object({ "bcc": z.array(z.string()).optional(), "cc": z.array(z.string()).optional(), "content": z.array(z.string()).optional(), "name": z.union([z.string(), z.null()]).optional(), "recipients": z.array(z.string()).optional(), "sender": z.union([z.string(), z.null()]).optional(), "user_id": z.union([z.string(), z.null()]).optional() }), "message_id": z.union([z.string().uuid(), z.null()]).optional(), "score": z.union([z.number(), z.null()]).optional(), "sender_id": z.union([z.string(), z.null()]).optional(), "thread_id": z.union([z.string().uuid(), z.null()]).optional(), "updated_at": z.union([z.number().int(), z.null()]).optional() })), "channel_type": z.string(), "id": z.string().uuid(), "metadata": z.union([z.object({ "created_at": z.number().int(), "interacted_at": z.union([z.number().int(), z.null()]).optional(), "updated_at": z.number().int(), "viewed_at": z.union([z.number().int(), z.null()]).optional() }), z.null()]).optional(), "owner_id": z.union([z.string(), z.null()]).optional(), "type": z.literal("channel") }), z.object({ "created_at": z.number().int(), "id": z.string().uuid(), "metadata": z.union([z.object({ "created_at": z.number().int(), "deleted_at": z.union([z.number().int(), z.null()]).optional(), "parent_project_id": z.union([z.string(), z.null()]).optional(), "updated_at": z.number().int(), "viewed_at": z.union([z.number().int(), z.null()]).optional() }), z.null()]).optional(), "name": z.string(), "owner_id": z.string(), "project_search_results": z.array(z.object({ "highlight": z.object({ "bcc": z.array(z.string()).optional(), "cc": z.array(z.string()).optional(), "content": z.array(z.string()).optional(), "name": z.union([z.string(), z.null()]).optional(), "recipients": z.array(z.string()).optional(), "sender": z.union([z.string(), z.null()]).optional(), "user_id": z.union([z.string(), z.null()]).optional() }), "score": z.union([z.number(), z.null()]).optional() })), "type": z.literal("project"), "updated_at": z.number().int() })];+ const errors = schemas.reduce<z.ZodError[]>(+ (errors, schema) =>+ ((result) =>+ result.error ? [...errors, result.error] : errors)(+ schema.safeParse(x),+ ),+ [],+ );+ if (schemas.length - errors.length !== 1) {+ ctx.addIssue({+ path: ctx.path,+ code: "invalid_union",+ unionErrors: errors,+ message: "Invalid input: Should pass single schema",+ });+ }+ })) })++export const ListDocuments = z.object({ "exhaustiveSearch": z.boolean().default(false), "fileTypes": z.union([z.array(z.string()), z.null()]), "minAccessLevel": z.union([z.literal("view"), z.literal("comment"), z.literal("edit"), z.literal("owner"), z.literal(null)]), "pageOffset": z.number().int().default(0), "pageSize": z.number().int().default(50) }).strict()@@ -22,29 +46,14 @@ export const MarkdownRewrite = z.object({ "instructions": z.string(), "markdown_export const AIDiffResponse = z.object({ "diffs": z.array(z.object({ "markdown_text": z.string(), "node_key": z.string(), "operation": z.string() }).strict()) }).strict()+export const NameSearch = z.object({ "entityTypes": z.array(z.enum(["documents","chats","emails","channels","projects"])).default([]), "name": z.string() }).strict()++export const Read = z.object({ "contentType": z.enum(["document","channel","channel-message","chat-thread","chat-message","email-thread","email-message","project"]), "ids": z.array(z.string()), "messagesSince": z.union([z.string().datetime({ offset: true }), z.null()]) }).strict()export const ReadResponse = z.object({ "content": z.any().superRefine((x, ctx) => {- const schemas = [z.object({ "documents": z.array(z.object({ "formattedDocument": z.string() })), "type": z.literal("documents") }), z.object({ "channel_id": z.string(), "channel_name": z.union([z.string(), z.null()]).optional(), "transcript": z.string(), "type": z.literal("channel") }), z.object({ "conversation": z.array(z.object({ "chat_id": z.string(), "messages": z.array(z.object({ "attachment_summaries": z.array(z.any().superRefine((x, ctx) => {- const schemas = [z.object({ "Summary": z.object({ "created_at": z.union([z.string().datetime({ offset: true }), z.null()]).optional(), "document_id": z.string(), "id": z.union([z.string(), z.null()]).optional(), "summary": z.string(), "version_id": z.string() }) }).strict(), z.object({ "NoSummary": z.object({ "document_id": z.string() }) }).strict()];- const errors = schemas.reduce<z.ZodError[]>(- (errors, schema) =>- ((result) =>- result.error ? [...errors, result.error] : errors)(- schema.safeParse(x),- ),- [],- );- if (schemas.length - errors.length !== 1) {- ctx.addIssue({- path: ctx.path,- code: "invalid_union",- unionErrors: errors,- message: "Invalid input: Should pass single schema",- });- }- })), "content": z.string(), "date": z.string().datetime({ offset: true }) })), "title": z.string() })), "type": z.literal("chat") }), z.object({ "messages": z.array(z.object({ "bcc": z.array(z.string()), "cc": z.array(z.string()), "content": z.string(), "messageId": z.string(), "recipients": z.array(z.string()), "sender": z.string(), "sentAt": z.union([z.string().datetime({ offset: true }), z.null()]).optional() })), "subject": z.union([z.string(), z.null()]).optional(), "thread_id": z.string(), "type": z.literal("email") }), z.object({ "formatted_preview": z.string(), "type": z.literal("itemPreviews") })];+ const schemas = [z.object({ "documents": z.array(z.object({ "formattedDocument": z.string() })), "type": z.literal("documents") }), z.object({ "channel_id": z.string(), "channel_name": z.union([z.string(), z.null()]).optional(), "transcript": z.string(), "type": z.literal("channel") }), z.object({ "conversation": z.array(z.object({ "chat_id": z.string(), "messages": z.array(z.object({ "attachmentIds": z.array(z.string()), "content": z.string(), "date": z.string().datetime({ offset: true }) })), "title": z.string() })), "type": z.literal("chat") }), z.object({ "messages": z.array(z.object({ "bcc": z.array(z.string()), "cc": z.array(z.string()), "content": z.string(), "messageId": z.string(), "recipients": z.array(z.string()), "sender": z.string(), "sentAt": z.union([z.string().datetime({ offset: true }), z.null()]).optional() })), "subject": z.union([z.string(), z.null()]).optional(), "thread_id": z.string(), "type": z.literal("email") }), z.object({ "formatted_preview": z.string(), "type": z.literal("itemPreviews") })];const errors = schemas.reduce<z.ZodError[]>((errors, schema) =>((result) =>@@ -64,30 +73,6 @@ export const ReadResponse = z.object({ "content": z.any().superRefine((x, ctx) =}) })-export const UnifiedSearch = z.object({ "exhaustiveSearch": z.boolean().default(true), "pageOffset": z.number().int().default(0), "pageSize": z.number().int().default(10), "request": z.object({ "filters": z.union([z.object({ "channel": z.union([z.object({ "channel_ids": z.array(z.string()), "mentions": z.array(z.string()), "org_id": z.union([z.number().int(), z.null()]), "sender_ids": z.array(z.string()), "thread_ids": z.array(z.string()) }).strict(), z.null()]), "chat": z.union([z.object({ "chat_ids": z.array(z.string()), "owners": z.array(z.string()), "project_ids": z.array(z.string()), "role": z.array(z.string()) }).strict(), z.null()]), "document": z.union([z.object({ "document_ids": z.array(z.string()), "file_types": z.array(z.string()), "owners": z.array(z.string()), "project_ids": z.array(z.string()) }).strict(), z.null()]), "email": z.union([z.object({ "bcc": z.array(z.string()), "cc": z.array(z.string()), "recipients": z.array(z.string()), "senders": z.array(z.string()) }).strict(), z.null()]), "project": z.union([z.object({ "owners": z.array(z.string()), "project_ids": z.array(z.string()) }).strict(), z.null()]) }).strict(), z.null()]), "include": z.array(z.enum(["documents","chats","emails","channels","projects"])).default([]), "match_type": z.enum(["exact","partial","regexp"]), "search_on": z.enum(["name","content","name_content"]).default("content"), "terms": z.union([z.array(z.string()), z.null()]) }).strict() }).strict()---export const UnifiedSearchResponseOutput = z.object({ "response": z.object({ "results": z.array(z.any().superRefine((x, ctx) => {- const schemas = [z.object({ "document_id": z.string().uuid(), "document_name": z.string(), "document_search_results": z.array(z.object({ "highlight": z.object({ "bcc": z.array(z.string()).optional(), "cc": z.array(z.string()).optional(), "content": z.array(z.string()).optional(), "name": z.union([z.string(), z.null()]).optional(), "recipients": z.array(z.string()).optional(), "sender": z.union([z.string(), z.null()]).optional(), "user_id": z.union([z.string(), z.null()]).optional() }), "node_id": z.union([z.string(), z.null()]).optional(), "raw_content": z.union([z.string(), z.null()]).optional(), "score": z.union([z.number(), z.null()]).optional() })), "file_type": z.union([z.string(), z.null()]).optional(), "id": z.string().uuid(), "metadata": z.union([z.object({ "created_at": z.number().int(), "deleted_at": z.union([z.number().int(), z.null()]).optional(), "project_id": z.union([z.string(), z.null()]).optional(), "updated_at": z.number().int(), "viewed_at": z.union([z.number().int(), z.null()]).optional() }), z.null()]).optional(), "name": z.string(), "owner_id": z.string(), "sub_type": z.union([z.literal("task"), z.null()]).optional(), "type": z.literal("document") }), z.object({ "chat_id": z.string().uuid(), "chat_search_results": z.array(z.object({ "chat_message_id": z.union([z.string().uuid(), z.null()]).optional(), "highlight": z.object({ "bcc": z.array(z.string()).optional(), "cc": z.array(z.string()).optional(), "content": z.array(z.string()).optional(), "name": z.union([z.string(), z.null()]).optional(), "recipients": z.array(z.string()).optional(), "sender": z.union([z.string(), z.null()]).optional(), "user_id": z.union([z.string(), z.null()]).optional() }), "role": z.union([z.string(), z.null()]).optional(), "score": z.union([z.number(), z.null()]).optional() })), "id": z.string().uuid(), "metadata": z.union([z.object({ "created_at": z.number().int(), "deleted_at": z.union([z.number().int(), z.null()]).optional(), "project_id": z.union([z.string(), z.null()]).optional(), "updated_at": z.number().int(), "viewed_at": z.union([z.number().int(), z.null()]).optional() }), z.null()]).optional(), "name": z.string(), "owner_id": z.string(), "type": z.literal("chat"), "user_id": z.string() }), z.object({ "created_at": z.number().int(), "email_message_search_results": z.array(z.object({ "bcc": z.array(z.string()), "cc": z.array(z.string()), "highlight": z.object({ "bcc": z.array(z.string()).optional(), "cc": z.array(z.string()).optional(), "content": z.array(z.string()).optional(), "name": z.union([z.string(), z.null()]).optional(), "recipients": z.array(z.string()).optional(), "sender": z.union([z.string(), z.null()]).optional(), "user_id": z.union([z.string(), z.null()]).optional() }), "labels": z.array(z.string()), "message_id": z.union([z.string().uuid(), z.null()]).optional(), "pretty_sender": z.string(), "recipients": z.array(z.string()), "score": z.union([z.number(), z.null()]).optional(), "sender": z.string(), "sent_at": z.union([z.number().int(), z.null()]).optional() })), "id": z.string().uuid(), "name": z.union([z.string(), z.null()]).optional(), "owner_id": z.string(), "snippet": z.union([z.string(), z.null()]).optional(), "subject": z.union([z.string(), z.null()]).optional(), "thread_id": z.string().uuid(), "type": z.literal("email"), "updated_at": z.number().int(), "user_id": z.string(), "viewed_at": z.union([z.number().int(), z.null()]).optional() }), z.object({ "channel_id": z.string().uuid(), "channel_message_search_results": z.array(z.object({ "created_at": z.union([z.number().int(), z.null()]).optional(), "highlight": z.object({ "bcc": z.array(z.string()).optional(), "cc": z.array(z.string()).optional(), "content": z.array(z.string()).optional(), "name": z.union([z.string(), z.null()]).optional(), "recipients": z.array(z.string()).optional(), "sender": z.union([z.string(), z.null()]).optional(), "user_id": z.union([z.string(), z.null()]).optional() }), "message_id": z.union([z.string().uuid(), z.null()]).optional(), "score": z.union([z.number(), z.null()]).optional(), "sender_id": z.union([z.string(), z.null()]).optional(), "thread_id": z.union([z.string().uuid(), z.null()]).optional(), "updated_at": z.union([z.number().int(), z.null()]).optional() })), "channel_type": z.string(), "id": z.string().uuid(), "metadata": z.union([z.object({ "created_at": z.number().int(), "interacted_at": z.union([z.number().int(), z.null()]).optional(), "updated_at": z.number().int(), "viewed_at": z.union([z.number().int(), z.null()]).optional() }), z.null()]).optional(), "owner_id": z.union([z.string(), z.null()]).optional(), "type": z.literal("channel") }), z.object({ "created_at": z.number().int(), "id": z.string().uuid(), "metadata": z.union([z.object({ "created_at": z.number().int(), "deleted_at": z.union([z.number().int(), z.null()]).optional(), "parent_project_id": z.union([z.string(), z.null()]).optional(), "updated_at": z.number().int(), "viewed_at": z.union([z.number().int(), z.null()]).optional() }), z.null()]).optional(), "name": z.string(), "owner_id": z.string(), "project_search_results": z.array(z.object({ "highlight": z.object({ "bcc": z.array(z.string()).optional(), "cc": z.array(z.string()).optional(), "content": z.array(z.string()).optional(), "name": z.union([z.string(), z.null()]).optional(), "recipients": z.array(z.string()).optional(), "sender": z.union([z.string(), z.null()]).optional(), "user_id": z.union([z.string(), z.null()]).optional() }), "score": z.union([z.number(), z.null()]).optional() })), "type": z.literal("project"), "updated_at": z.number().int() })];- const errors = schemas.reduce<z.ZodError[]>(- (errors, schema) =>- ((result) =>- result.error ? [...errors, result.error] : errors)(- schema.safeParse(x),- ),- [],- );- if (schemas.length - errors.length !== 1) {- ctx.addIssue({- path: ctx.path,- code: "invalid_union",- unionErrors: errors,- message: "Invalid input: Should pass single schema",- });- }- })), "resultsReturned": z.number().int().gte(0), "totalResults": z.number().int().gte(0) }), "responseSchema": z.any() })--export const WebSearchToolCall = z.object({ "query": z.string() })diff --git a/js/app/packages/service-clients/service-cognition/generated/tools/tool.ts b/js/app/packages/service-clients/service-cognition/generated/tools/tool.tsindex cbb7253a53..7d03516d64 100644--- a/js/app/packages/service-clients/service-cognition/generated/tools/tool.ts+++ b/js/app/packages/service-clients/service-cognition/generated/tools/tool.ts@@ -9,20 +9,22 @@ import * as schemas from './schemas';import type * as types from './types';type ToolParserMap = {+ContentSearch: { call: types.ContentSearch, response: types.SearchToolResponse }ListDocuments: { call: types.ListDocuments, response: types.ListDocumentsResponse }ListEmails: { call: types.ListEmails, response: types.ApiPaginatedThreadCursor }MarkdownRewrite: { call: types.MarkdownRewrite, response: types.AIDiffResponse }+NameSearch: { call: types.NameSearch, response: types.SearchToolResponse }Read: { call: types.Read, response: types.ReadResponse }-UnifiedSearch: { call: types.UnifiedSearch, response: types.UnifiedSearchResponseOutput }web_search: { call: types.WebSearchToolCall, response: types.WebSearchResponse }};const toolParserMap = {+ContentSearch: { call: schemas.ContentSearch, response: schemas.SearchToolResponse },ListDocuments: { call: schemas.ListDocuments, response: schemas.ListDocumentsResponse },ListEmails: { call: schemas.ListEmails, response: schemas.ApiPaginatedThreadCursor },MarkdownRewrite: { call: schemas.MarkdownRewrite, response: schemas.AIDiffResponse },+NameSearch: { call: schemas.NameSearch, response: schemas.SearchToolResponse },Read: { call: schemas.Read, response: schemas.ReadResponse },-UnifiedSearch: { call: schemas.UnifiedSearch, response: schemas.UnifiedSearchResponseOutput },web_search: { call: schemas.WebSearchToolCall, response: schemas.WebSearchResponse }};@@ -35,11 +37,12 @@ type NamedRawTool = {};type ToolDataMap = {+ContentSearch: { call: types.ContentSearch, response: types.SearchToolResponse };ListDocuments: { call: types.ListDocuments, response: types.ListDocumentsResponse };ListEmails: { call: types.ListEmails, response: types.ApiPaginatedThreadCursor };MarkdownRewrite: { call: types.MarkdownRewrite, response: types.AIDiffResponse };+NameSearch: { call: types.NameSearch, response: types.SearchToolResponse };Read: { call: types.Read, response: types.ReadResponse };-UnifiedSearch: { call: types.UnifiedSearch, response: types.UnifiedSearchResponseOutput };web_search: { call: types.WebSearchToolCall, response: types.WebSearchResponse };};diff --git a/js/app/packages/service-clients/service-cognition/generated/tools/types.ts b/js/app/packages/service-clients/service-cognition/generated/tools/types.tsindex 53844c7887..62a0afe165 100644--- a/js/app/packages/service-clients/service-cognition/generated/tools/types.ts+++ b/js/app/packages/service-clients/service-cognition/generated/tools/types.ts@@ -2,6 +2,481 @@* *DO NOT EDIT MANUALLY***/+/* eslint-disable */+/**+ * This file was automatically generated by json-schema-to-typescript.+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,+ * and run json-schema-to-typescript to regenerate this file.+ */++/**+ * Search for items by their content. For documents, this searches the document body text. For emails, this searches the email message body. For chats, this searches the message content. This tool finds items based on what's inside them, not their titles or names.+ */+export interface ContentSearch {+ /**+ * Which types of items to search. Leave empty to search all types. Examples: ['documents'], ['emails', 'documents'], ['channels']+ */+ entityTypes: ('documents' | 'chats' | 'emails' | 'channels' | 'projects')[];+ /**+ * The text content to search for. This searches within the body of documents, emails, and messages.+ */+ query: string;+}+++/* eslint-disable */+/**+ * This file was automatically generated by json-schema-to-typescript.+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,+ * and run json-schema-to-typescript to regenerate this file.+ */++export interface SearchToolResponse {+ results: (+ | {+ /**+ * The id of the document+ */+ document_id: string;+ /**+ * The name of the document+ */+ document_name: string;+ /**+ * The search results for the document+ * This may be empty if the search result match was on the document name only+ */+ document_search_results: {+ /**+ * The highlights for the document+ */+ highlight: {+ /**+ * The highlight match on the bcc (email only)+ */+ bcc?: string[];+ /**+ * The highlight match on the cc (email only)+ */+ cc?: string[];+ /**+ * The highlight match on the content field+ */+ content?: string[];+ /**+ * The highlight match on the name field+ */+ name?: string | null;+ /**+ * The highlight match on the recipients (email only)+ */+ recipients?: string[];+ /**+ * The highlight match on the sender (email only)+ */+ sender?: string | null;+ /**+ * The highlight match on the user (owner) of the entity+ */+ user_id?: string | null;+ };+ /**+ * The node id for the document.+ * This is only useful for markdown at the moment+ * This will only be provided if the match was on content+ */+ node_id?: string | null;+ /**+ * The raw content of the document.+ * This is only included for markdown files and will be the raw json node of the match+ */+ raw_content?: string | null;+ /**+ * The score of the result+ */+ score?: number | null;+ }[];+ /**+ * The file type of the document+ */+ file_type?: string | null;+ /**+ * Standardized fields that all item types will share.+ * These field names are being aligned across all item types+ * for consistency in our data model.+ */+ id: string;+ /**+ * Metadata from the database. None if the document doesn't exist in the database.+ */+ metadata?: {+ created_at: number;+ deleted_at?: number | null;+ project_id?: string | null;+ updated_at: number;+ viewed_at?: number | null;+ } | null;+ name: string;+ owner_id: string;+ /**+ * The sub type of the document if present.+ */+ sub_type?: 'task' | null;+ type: 'document';+ }+ | {+ /**+ * The id of the chat+ */+ chat_id: string;+ /**+ * The search results for the chat+ * This may be empty if the search result match was on the chat title only+ */+ chat_search_results: {+ /**+ * The chat message id for the chat+ * This is only present if the search match was on the chat message content+ */+ chat_message_id?: string | null;+ /**+ * The highlights for the chat message+ */+ highlight: {+ /**+ * The highlight match on the bcc (email only)+ */+ bcc?: string[];+ /**+ * The highlight match on the cc (email only)+ */+ cc?: string[];+ /**+ * The highlight match on the content field+ */+ content?: string[];+ /**+ * The highlight match on the name field+ */+ name?: string | null;+ /**+ * The highlight match on the recipients (email only)+ */+ recipients?: string[];+ /**+ * The highlight match on the sender (email only)+ */+ sender?: string | null;+ /**+ * The highlight match on the user (owner) of the entity+ */+ user_id?: string | null;+ };+ /**+ * The role of the chat message+ * This is only present if the search match was on the chat message content+ */+ role?: string | null;+ /**+ * The score of the result+ */+ score?: number | null;+ }[];+ /**+ * Standardized fields that all item types will share.+ * These field names are being aligned across all item types+ * for consistency in our data model.+ */+ id: string;+ /**+ * Metadata from the database. None if the chat doesn't exist in the database.+ */+ metadata?: {+ created_at: number;+ deleted_at?: number | null;+ project_id?: string | null;+ updated_at: number;+ viewed_at?: number | null;+ } | null;+ name: string;+ owner_id: string;+ type: 'chat';+ /**+ * The id of the creator of the chat+ */+ user_id: string;+ }+ | {+ created_at: number;+ /**+ * The search results for the document+ * This may be empty if the search result match was on the email subject only+ */+ email_message_search_results: {+ /**+ * This is only present if the search result is on the message content+ */+ bcc: string[];+ /**+ * This is only present if the search result is on the message content+ */+ cc: string[];+ /**+ * The highlights for the email message+ */+ highlight: {+ /**+ * The highlight match on the bcc (email only)+ */+ bcc?: string[];+ /**+ * The highlight match on the cc (email only)+ */+ cc?: string[];+ /**+ * The highlight match on the content field+ */+ content?: string[];+ /**+ * The highlight match on the name field+ */+ name?: string | null;+ /**+ * The highlight match on the recipients (email only)+ */+ recipients?: string[];+ /**+ * The highlight match on the sender (email only)+ */+ sender?: string | null;+ /**+ * The highlight match on the user (owner) of the entity+ */+ user_id?: string | null;+ };+ /**+ * This is only present if the search result is on the message content+ */+ labels: string[];+ /**+ * The email message id.+ * This is only present if the search result is on the message content+ */+ message_id?: string | null;+ /**+ * The pretty sender.+ * If the match is on the subject, the pretty sender is the latest sender on the thread.+ * This could be the sender's email if there is no contact name for the sender.+ */+ pretty_sender: string;+ /**+ * This is only present if the search result is on the message content+ */+ recipients: string[];+ /**+ * The score of the result+ */+ score?: number | null;+ /**+ * The sender.+ * If the match is on the subject, the sender is the latest sender on the thread.+ */+ sender: string;+ /**+ * When the email message was sent+ * This is only present if the search result is on the message content+ */+ sent_at?: number | null;+ }[];+ /**+ * Standardized fields that all item types will share.+ * These field names are being aligned across all item types+ * for consistency in our data model.+ */+ id: string;+ /**+ * Subject of the email thread+ */+ name?: string | null;+ owner_id: string;+ snippet?: string | null;+ /**+ * The subject of the email+ * This is only present if the search result is on the message content+ */+ subject?: string | null;+ /**+ * The id of the email thread+ */+ thread_id: string;+ type: 'email';+ updated_at: number;+ /**+ * The id of the owner of the email thread+ */+ user_id: string;+ viewed_at?: number | null;+ }+ | {+ /**+ * The id of the channel+ */+ channel_id: string;+ /**+ * The search results for the channel+ * This may be empty if the search result match was not on content+ */+ channel_message_search_results: {+ /**+ * When the channel message was created+ * This is only prsent if the search result is on the message content+ */+ created_at?: number | null;+ /**+ * The highlights for the channel message+ */+ highlight: {+ /**+ * The highlight match on the bcc (email only)+ */+ bcc?: string[];+ /**+ * The highlight match on the cc (email only)+ */+ cc?: string[];+ /**+ * The highlight match on the content field+ */+ content?: string[];+ /**+ * The highlight match on the name field+ */+ name?: string | null;+ /**+ * The highlight match on the recipients (email only)+ */+ recipients?: string[];+ /**+ * The highlight match on the sender (email only)+ */+ sender?: string | null;+ /**+ * The highlight match on the user (owner) of the entity+ */+ user_id?: string | null;+ };+ /**+ * The channel message id+ * This is only prsent if the search result is on the message content+ */+ message_id?: string | null;+ /**+ * The score of the result+ */+ score?: number | null;+ /**+ * The sender id+ * This is only prsent if the search result is on the message content+ */+ sender_id?: string | null;+ /**+ * The channel message thread id+ */+ thread_id?: string | null;+ /**+ * When the channel message was last updated+ * This is only prsent if the search result is on the message content+ */+ updated_at?: number | null;+ }[];+ /**+ * The type of channel+ */+ channel_type: string;+ /**+ * Standardized fields that all item types will share.+ * These field names are being aligned across all item types+ * for consistency in our data model.+ */+ id: string;+ /**+ * Metadata from the database. None if the channel doesn't exist in the database.+ */+ metadata?: {+ created_at: number;+ interacted_at?: number | null;+ updated_at: number;+ viewed_at?: number | null;+ } | null;+ /**+ * we don't store this for channels atm but keeping it here for consistency+ */+ owner_id?: string | null;+ type: 'channel';+ }+ | {+ created_at: number;+ /**+ * Standardized fields that all item types will share.+ * These field names are being aligned across all item types+ * for consistency in our data model.+ */+ id: string;+ /**+ * Metadata from the database. None if the project doesn't exist in the database.+ */+ metadata?: {+ created_at: number;+ deleted_at?: number | null;+ parent_project_id?: string | null;+ updated_at: number;+ viewed_at?: number | null;+ } | null;+ name: string;+ owner_id: string;+ project_search_results: {+ highlight: {+ /**+ * The highlight match on the bcc (email only)+ */+ bcc?: string[];+ /**+ * The highlight match on the cc (email only)+ */+ cc?: string[];+ /**+ * The highlight match on the content field+ */+ content?: string[];+ /**+ * The highlight match on the name field+ */+ name?: string | null;+ /**+ * The highlight match on the recipients (email only)+ */+ recipients?: string[];+ /**+ * The highlight match on the sender (email only)+ */+ sender?: string | null;+ /**+ * The highlight match on the user (owner) of the entity+ */+ user_id?: string | null;+ };+ /**+ * The score of the result+ */+ score?: number | null;+ }[];+ type: 'project';+ updated_at: number;+ }+ )[];+}++/* eslint-disable *//*** This file was automatically generated by json-schema-to-typescript.@@ -257,6 +732,28 @@ export interface AIDiffResponse {}+/* eslint-disable */+/**+ * This file was automatically generated by json-schema-to-typescript.+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,+ * and run json-schema-to-typescript to regenerate this file.+ */++/**+ * Search for items by their name or title. For documents, this searches the document name. For emails, this searches the subject line. For chats, this searches the chat title. For projects (folders), this searches the project name. This tool finds items based on what they're called, not their content.+ */+export interface NameSearch {+ /**+ * Which types of items to search. Leave empty to search all types. Examples: ['documents'], ['emails', 'documents'], ['channels']+ */+ entityTypes: ('documents' | 'chats' | 'emails' | 'channels' | 'projects')[];+ /**+ * The name or title to search for. For emails, this is the subject line. For channels, this can be the channel name or participant names.+ */+ name: string;+}++/* eslint-disable *//*** This file was automatically generated by json-schema-to-typescript.@@ -317,22 +814,7 @@ export interface ReadResponse {conversation: {chat_id: string;messages: {- attachment_summaries: (- | {- Summary: {- created_at?: string | null;- document_id: string;- id?: string | null;- summary: string;- version_id: string;- };- }- | {- NoSummary: {- document_id: string;- };- }- )[];+ attachmentIds: string[];content: string;date: string;}[];@@ -361,635 +843,6 @@ export interface ReadResponse {}-/* eslint-disable */-/**- * This file was automatically generated by json-schema-to-typescript.- * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,- * and run json-schema-to-typescript to regenerate this file.- */--/**- * Universal search across all content types (documents, emails, AI conversations, chat/slack threads/channels, projects aka folders). This tool will return broad metadata from successful results and/or content matches. Use the Read tool next to read the results from those matches. Only ever refer to documents by name or with a document mention. Never state the id of the document in plaintext. User's are presented with the results of this tool as a UI element so there is no need to enumerate the information found from this tool.- */-export interface UnifiedSearch {- /**- * Exhaustive search across all results matching the query. Defaults to true. Use false when the user only requires a limitied subset of results to answer the question- */- exhaustiveSearch: boolean;- /**- * Page offset. Default is 0. Use a higher offset to page through results intelligently. Set exhaustive_search to true to get all results.- */- pageOffset: number;- /**- * Search count per search type (i.e. applies separately to each of documents, emails, ai_conversations, chats, projects). Max is 100. Default is 10. Does not apply when exhaustive_search is set to true.- */- pageSize: number;- /**- * Aggregated search request, see individual fields for details- */- request: {- /**- * Search filters for various kinds of items. Set the entire filters property as `null` if you do not have specific filters for a given type, e.g. bcc for email filters.- */- filters: {- /**- * Channel filters. `null` to not filter channels searched over.- */- channel: {- /**- * Channel IDs to search within. Examples: ['general']. Empty to search all accessible channels.- */- channel_ids: string[];- /**- * Channel user mentions to search for. Examples: ['@username']. Empty if not filtering by mentions.- */- mentions: string[];- /**- * Channel organization ID to search within. Empty to ignore organization filtering.- */- org_id: number | null;- /**- * Sender IDs to search within. Examples: ['user1']. Empty to search all accessible senders.- */- sender_ids: string[];- /**- * Channel thread IDs to search within. Examples: ['thread123']. Empty to search all threads.- */- thread_ids: string[];- } | null;- /**- * Chat filters. `null` to not filter chats searched over.- */- chat: {- /**- * Chat ids to search over. Examples: ['chat1'], ['chat1', 'chat2']. When provided, chat search will only match results on these chats. Empty to search all accessible chats.- */- chat_ids: string[];- /**- * Filter by chat owner. Examples: ['macro|[email protected]'], ['macro|[email protected]', 'macro|[email protected]']. Empty to search all owners.- */- owners: string[];- /**- * A list of project ids to search within. Examples: ['project1']. Empty to ignore project filtering.- */- project_ids: string[];- /**- * Chat message roles to search. Examples: ['user'], ['assistant']. Empty to search all roles.- */- role: string[];- } | null;- /**- * Document filters. `null` to not filter documents searched over.- */- document: {- /**- * Document ids to search over. Examples: ['doc1'], ['doc1', 'doc2']. Empty to search all accessible documents.- */- document_ids: string[];- /**- * Document file types to search. Examples: ['pdf'], ['md', 'txt']. Empty to search all file types.- */- file_types: string[];- /**- * Filter by document owner. Examples: ['macro|[email protected]'], ['macro|[email protected]', 'macro|[email protected]']. Empty to search all owners.- */- owners: string[];- /**- * A list of project ids to search within. Examples: ['project1'].- * filtering. Empty to ignore project filtering.- */- project_ids: string[];- } | null;- /**- * Email filters. `null` to not filter emails searched over.- */- email: {- /**- * Email BCC addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by BCC.- */- bcc: string[];- /**- * Email CC addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by CC.- */- cc: string[];- /**- * Email Recipient addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by Recipient.- */- recipients: string[];- /**- * Email sender addresses to filter by. Examples: ['[email protected]']. Empty to search all senders.- */- senders: string[];- } | null;- /**- * Project filters. `null` to not filter projects searched over.- */- project: {- /**- * Filter by project owner. Examples: ['macro|[email protected]'], ['macro|[email protected]', 'macro|[email protected]']. Empty to search all owners.- */- owners: string[];- /**- * Project IDs to search within. Examples: ['project1']. Empty to search all accessible projects.- */- project_ids: string[];- } | null;- } | null;- /**- * Include specific entity types from search. If empty, all entity types will be searched over. If you are unsure which types to search, use an empty array to search all.- */- include: ('documents' | 'chats' | 'emails' | 'channels' | 'projects')[];- /**- * How to match the search terms. 'exact' for precise case-sensitive phrase matches, 'partial' for prefix/partial matches. REQUIRED field.- */- match_type: 'exact' | 'partial' | 'regexp';- /**- * Fields to search on (Name, Content, NameContent). Defaults to Content- */- search_on: 'name' | 'content' | 'name_content';- /**- * Multiple distinct search terms as separate strings. Use this for keyword-based searches where you want to find content containing any of these terms. Each term must be at least 3 characters (shorter terms are automatically filtered out). Examples: ['machine', 'learning', 'algorithms'], ['project', 'status', 'update']. `null` this field if searching without text terms to search all. This field matches query string against both name and content.- */- terms: string[] | null;- };-}---/* eslint-disable */-/**- * This file was automatically generated by json-schema-to-typescript.- * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,- * and run json-schema-to-typescript to regenerate this file.- */--export interface UnifiedSearchResponseOutput {- /**- * The search results- */- response: {- /**- * The search results (truncated to `results_returned` limit if applicable)- */- results: (- | {- /**- * The id of the document- */- document_id: string;- /**- * The name of the document- */- document_name: string;- /**- * The search results for the document- * This may be empty if the search result match was on the document name only- */- document_search_results: {- /**- * The highlights for the document- */- highlight: {- /**- * The highlight match on the bcc (email only)- */- bcc?: string[];- /**- * The highlight match on the cc (email only)- */- cc?: string[];- /**- * The highlight match on the content field- */- content?: string[];- /**- * The highlight match on the name field- */- name?: string | null;- /**- * The highlight match on the recipients (email only)- */- recipients?: string[];- /**- * The highlight match on the sender (email only)- */- sender?: string | null;- /**- * The highlight match on the user (owner) of the entity- */- user_id?: string | null;- };- /**- * The node id for the document.- * This is only useful for markdown at the moment- * This will only be provided if the match was on content- */- node_id?: string | null;- /**- * The raw content of the document.- * This is only included for markdown files and will be the raw json node of the match- */- raw_content?: string | null;- /**- * The score of the result- */- score?: number | null;- }[];- /**- * The file type of the document- */- file_type?: string | null;- /**- * Standardized fields that all item types will share.- * These field names are being aligned across all item types- * for consistency in our data model.- */- id: string;- /**- * Metadata from the database. None if the document doesn't exist in the database.- */- metadata?: {- created_at: number;- deleted_at?: number | null;- project_id?: string | null;- updated_at: number;- viewed_at?: number | null;- } | null;- name: string;- owner_id: string;- /**- * The sub type of the document if present.- */- sub_type?: 'task' | null;- type: 'document';- }- | {- /**- * The id of the chat- */- chat_id: string;- /**- * The search results for the chat- * This may be empty if the search result match was on the chat title only- */- chat_search_results: {- /**- * The chat message id for the chat- * This is only present if the search match was on the chat message content- */- chat_message_id?: string | null;- /**- * The highlights for the chat message- */- highlight: {- /**- * The highlight match on the bcc (email only)- */- bcc?: string[];- /**- * The highlight match on the cc (email only)- */- cc?: string[];- /**- * The highlight match on the content field- */- content?: string[];- /**- * The highlight match on the name field- */- name?: string | null;- /**- * The highlight match on the recipients (email only)- */- recipients?: string[];- /**- * The highlight match on the sender (email only)- */- sender?: string | null;- /**- * The highlight match on the user (owner) of the entity- */- user_id?: string | null;- };- /**- * The role of the chat message- * This is only present if the search match was on the chat message content- */- role?: string | null;- /**- * The score of the result- */- score?: number | null;- }[];- /**- * Standardized fields that all item types will share.- * These field names are being aligned across all item types- * for consistency in our data model.- */- id: string;- /**- * Metadata from the database. None if the chat doesn't exist in the database.- */- metadata?: {- created_at: number;- deleted_at?: number | null;- project_id?: string | null;- updated_at: number;- viewed_at?: number | null;- } | null;- name: string;- owner_id: string;- type: 'chat';- /**- * The id of the creator of the chat- */- user_id: string;- }- | {- created_at: number;- /**- * The search results for the document- * This may be empty if the search result match was on the email subject only- */- email_message_search_results: {- /**- * This is only present if the search result is on the message content- */- bcc: string[];- /**- * This is only present if the search result is on the message content- */- cc: string[];- /**- * The highlights for the email message- */- highlight: {- /**- * The highlight match on the bcc (email only)- */- bcc?: string[];- /**- * The highlight match on the cc (email only)- */- cc?: string[];- /**- * The highlight match on the content field- */- content?: string[];- /**- * The highlight match on the name field- */- name?: string | null;- /**- * The highlight match on the recipients (email only)- */- recipients?: string[];- /**- * The highlight match on the sender (email only)- */- sender?: string | null;- /**- * The highlight match on the user (owner) of the entity- */- user_id?: string | null;- };- /**- * This is only present if the search result is on the message content- */- labels: string[];- /**- * The email message id.- * This is only present if the search result is on the message content- */- message_id?: string | null;- /**- * The pretty sender.- * If the match is on the subject, the pretty sender is the latest sender on the thread.- * This could be the sender's email if there is no contact name for the sender.- */- pretty_sender: string;- /**- * This is only present if the search result is on the message content- */- recipients: string[];- /**- * The score of the result- */- score?: number | null;- /**- * The sender.- * If the match is on the subject, the sender is the latest sender on the thread.- */- sender: string;- /**- * When the email message was sent- * This is only present if the search result is on the message content- */- sent_at?: number | null;- }[];- /**- * Standardized fields that all item types will share.- * These field names are being aligned across all item types- * for consistency in our data model.- */- id: string;- /**- * Subject of the email thread- */- name?: string | null;- owner_id: string;- snippet?: string | null;- /**- * The subject of the email- * This is only present if the search result is on the message content- */- subject?: string | null;- /**- * The id of the email thread- */- thread_id: string;- type: 'email';- updated_at: number;- /**- * The id of the owner of the email thread- */- user_id: string;- viewed_at?: number | null;- }- | {- /**- * The id of the channel- */- channel_id: string;- /**- * The search results for the channel- * This may be empty if the search result match was not on content- */- channel_message_search_results: {- /**- * When the channel message was created- * This is only prsent if the search result is on the message content- */- created_at?: number | null;- /**- * The highlights for the channel message- */- highlight: {- /**- * The highlight match on the bcc (email only)- */- bcc?: string[];- /**- * The highlight match on the cc (email only)- */- cc?: string[];- /**- * The highlight match on the content field- */- content?: string[];- /**- * The highlight match on the name field- */- name?: string | null;- /**- * The highlight match on the recipients (email only)- */- recipients?: string[];- /**- * The highlight match on the sender (email only)- */- sender?: string | null;- /**- * The highlight match on the user (owner) of the entity- */- user_id?: string | null;- };- /**- * The channel message id- * This is only prsent if the search result is on the message content- */- message_id?: string | null;- /**- * The score of the result- */- score?: number | null;- /**- * The sender id- * This is only prsent if the search result is on the message content- */- sender_id?: string | null;- /**- * The channel message thread id- */- thread_id?: string | null;- /**- * When the channel message was last updated- * This is only prsent if the search result is on the message content- */- updated_at?: number | null;- }[];- /**- * The type of channel- */- channel_type: string;- /**- * Standardized fields that all item types will share.- * These field names are being aligned across all item types- * for consistency in our data model.- */- id: string;- /**- * Metadata from the database. None if the channel doesn't exist in the database.- */- metadata?: {- created_at: number;- interacted_at?: number | null;- updated_at: number;- viewed_at?: number | null;- } | null;- /**- * we don't store this for channels atm but keeping it here for consistency- */- owner_id?: string | null;- type: 'channel';- }- | {- created_at: number;- /**- * Standardized fields that all item types will share.- * These field names are being aligned across all item types- * for consistency in our data model.- */- id: string;- /**- * Metadata from the database. None if the project doesn't exist in the database.- */- metadata?: {- created_at: number;- deleted_at?: number | null;- parent_project_id?: string | null;- updated_at: number;- viewed_at?: number | null;- } | null;- name: string;- owner_id: string;- project_search_results: {- highlight: {- /**- * The highlight match on the bcc (email only)- */- bcc?: string[];- /**- * The highlight match on the cc (email only)- */- cc?: string[];- /**- * The highlight match on the content field- */- content?: string[];- /**- * The highlight match on the name field- */- name?: string | null;- /**- * The highlight match on the recipients (email only)- */- recipients?: string[];- /**- * The highlight match on the sender (email only)- */- sender?: string | null;- /**- * The highlight match on the user (owner) of the entity- */- user_id?: string | null;- };- /**- * The score of the result- */- score?: number | null;- }[];- type: 'project';- updated_at: number;- }- )[];- /**- * the number of results returned- */- resultsReturned: number;- /**- * total number of results from search- */- totalResults: number;- };- /**- * The JSON schema for the response so the LLM can understand it- */- responseSchema: {- [k: string]: unknown;- };-}--/* eslint-disable *//*** This file was automatically generated by json-schema-to-typescript.diff --git a/js/app/scripts/generate-dcs-tools.ts b/js/app/scripts/generate-dcs-tools.tsindex 10f23bac7c..5fc23b0a82 100644--- a/js/app/scripts/generate-dcs-tools.ts+++ b/js/app/scripts/generate-dcs-tools.ts@@ -59,27 +59,35 @@ async function fetchAIToolsSchemas(): Promise<AiToolsResponse> {}async function generateSchemasFile(tools: AiToolsResponse) {- // Generate all schemas+ // Generate all schemas, deduplicating by title+ const generatedSchemas = new Set<string>();const content: Array<string> = [];+for (const tool of tools) {// jsonSchemaToZod with name option generates a proper exportconst { resolved: inputSchema } = await resolveRefs(tool.inputSchema);- const inputCode = jsonSchemaToZod(inputSchema, {- module: "esm",- name: inputSchema.title,- withoutDescribes: true,- noImport: true,- });+ if (!generatedSchemas.has(inputSchema.title)) {+ const inputCode = jsonSchemaToZod(inputSchema, {+ module: "esm",+ name: inputSchema.title,+ withoutDescribes: true,+ noImport: true,+ });+ content.push(inputCode);+ generatedSchemas.add(inputSchema.title);+ }const { resolved: outputSchema } = await resolveRefs(tool.outputSchema);- const outputCode = jsonSchemaToZod(outputSchema, {- module: "esm",- name: outputSchema.title,- withoutDescribes: true,- noImport: true,- });-- content.push(`${inputCode}\n\n${outputCode}`);+ if (!generatedSchemas.has(outputSchema.title)) {+ const outputCode = jsonSchemaToZod(outputSchema, {+ module: "esm",+ name: outputSchema.title,+ withoutDescribes: true,+ noImport: true,+ });+ content.push(outputCode);+ generatedSchemas.add(outputSchema.title);+ }}const contents = `${warning}@@ -92,47 +100,55 @@ ${content.join("\n\n")}}async function generateToolTypesFile(tools: AiToolsResponse) {- // Generate all schemas+ // Generate all schemas, deduplicating by title+ const generatedTypes = new Set<string>();const content: Array<string> = [];+for (const tool of tools) {- const inputCode = await compile(- tool.inputSchema,- tool.inputSchema.title,- {- // override top level name for export- customName: (schema) => {- if (schema.title) {- console.log(`Using schema title: ${schema.title}`);- return schema.title;- }- },- additionalProperties: false,- style: {- singleQuote: true,+ if (!generatedTypes.has(tool.inputSchema.title)) {+ const inputCode = await compile(+ tool.inputSchema,+ tool.inputSchema.title,+ {+ // override top level name for export+ customName: (schema) => {+ if (schema.title) {+ console.log(`Using schema title: ${schema.title}`);+ return schema.title;+ }+ },+ additionalProperties: false,+ style: {+ singleQuote: true,+ },},- },- );-- const outputCode = await compile(- tool.outputSchema,- tool.outputSchema.title,- {- // override top level name for export- customName: (schema) => {- if (schema.title) {- console.log(`Using schema title: ${schema.title}`);- return schema.title;- }- return undefined;+ );+ content.push(inputCode);+ generatedTypes.add(tool.inputSchema.title);+ }++ if (!generatedTypes.has(tool.outputSchema.title)) {+ const outputCode = await compile(+ tool.outputSchema,+ tool.outputSchema.title,+ {+ // override top level name for export+ customName: (schema) => {+ if (schema.title) {+ console.log(`Using schema title: ${schema.title}`);+ return schema.title;+ }+ return undefined;+ },+ additionalProperties: false,+ style: {+ singleQuote: true,+ },},- additionalProperties: false,- style: {- singleQuote: true,- },- },- );-- content.push(`${inputCode}\n\n${outputCode}`);+ );+ content.push(outputCode);+ generatedTypes.add(tool.outputSchema.title);+ }}const contents = `${warning}diff --git a/rust/cloud-storage/ai_tools/src/lib.rs b/rust/cloud-storage/ai_tools/src/lib.rsindex b735bc024f..bf1abc3030 100644--- a/rust/cloud-storage/ai_tools/src/lib.rs+++ b/rust/cloud-storage/ai_tools/src/lib.rs@@ -6,7 +6,7 @@ pub mod read;pub mod rewrite;pub mod search;mod tool_context;-use search::anthropic_web_search::anthropic_web_search_tool;+use search::web::anthropic_web_search::anthropic_web_search_tool;pub use search::search_toolset;pub use tool_context::*;diff --git a/rust/cloud-storage/ai_tools/src/prompts/all_tools.md b/rust/cloud-storage/ai_tools/src/prompts/all_tools.mdindex 747026d179..7b46a3040e 100644--- a/rust/cloud-storage/ai_tools/src/prompts/all_tools.md+++ b/rust/cloud-storage/ai_tools/src/prompts/all_tools.md@@ -33,6 +33,7 @@ General citation rules:- You may cite links by using a standard markdown link: [text](url)- To cite documents use the following citation formats. If no id's are present in your converstation chain do notcite documents.+- Use citations oftenCiting Pdfs:You can cite a specific part of a pdf by using the ID's that are included in the PDF context.They@@ -111,7 +112,11 @@ If no inline or node ids are present:- Use tools often and specifically.- Prefer precise filters (domain names, IDs) over generic queries.- Web tool expects natural language queries.-- Unified search tool expects specificity (project names, IDs).++- IMPORTANT After finding relavent results with any tool cite the most relavent findings+ using mentions. Use the above mention format. Always use a mention if the tool+ returns anything relavent. IMPORTANT+## Tool usage patterns:diff --git a/rust/cloud-storage/ai_tools/src/search/mod.rs b/rust/cloud-storage/ai_tools/src/search/mod.rsindex 59ef547997..ad5ba28174 100644--- a/rust/cloud-storage/ai_tools/src/search/mod.rs+++ b/rust/cloud-storage/ai_tools/src/search/mod.rs@@ -1,18 +1,13 @@use crate::AiToolSet;use ai::tool::AsyncToolSet;-#[allow(unused)]-mod perplexity_search;--/// Schemas for frontend type generation for the builtin claude web search tool-/// <https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool>-/// This tool is built into anthropic so is not included in the toolset / sent in the request-pub mod anthropic_web_search;--mod unified;+mod search_service;+pub mod web;pub fn search_toolset() -> AiToolSet {AsyncToolSet::new()- .add_tool::<unified::UnifiedSearch>()- .expect("failed to add unified search tool")+ .add_tool::<search_service::name::NameSearch>()+ .expect("failed to add name search tool")+ .add_tool::<search_service::content::ContentSearch>()+ .expect("failed to add content search tool")}diff --git a/rust/cloud-storage/ai_tools/src/search/search_service/content.rs b/rust/cloud-storage/ai_tools/src/search/search_service/content.rsnew file mode 100644index 0000000000..8762c08424--- /dev/null+++ b/rust/cloud-storage/ai_tools/src/search/search_service/content.rs@@ -0,0 +1,99 @@+use super::types::{PAGE_SIZE, SearchToolResponse};+use crate::tool_context::{RequestContext, ToolServiceContext};+use ai::tool::{AsyncTool, ToolCallError, ToolResult};+use async_trait::async_trait;+use models_search::{+ MatchType,+ unified::{UnifiedSearchIndex, UnifiedSearchRequest},+};+use schemars::JsonSchema;+use serde::Deserialize;++#[derive(Debug, JsonSchema, Deserialize, Clone)]+#[serde(rename_all = "camelCase")]+#[schemars(+ description = "Search for items by their content. For documents, this searches the document body text. For emails, this searches the email message body. For chats, this searches the message content. This tool finds items based on what's inside them, not their titles or names.",+ title = "ContentSearch"+)]+pub struct ContentSearch {+ #[schemars(+ description = "The text content to search for. This searches within the body of documents, emails, and messages."+ )]+ pub query: String,++ #[schemars(+ description = "Which types of items to search. Leave empty to search all types. Examples: ['documents'], ['emails', 'documents'], ['channels']"+ )]+ #[serde(default)]+ pub entity_types: Vec<UnifiedSearchIndex>,+}++#[async_trait]+impl AsyncTool<ToolServiceContext, RequestContext> for ContentSearch {+ type Output = SearchToolResponse;++ #[tracing::instrument(skip_all, fields(user_id=?request_context.user_id), err)]+ async fn call(+ &self,+ context: ToolServiceContext,+ request_context: RequestContext,+ ) -> ToolResult<Self::Output> {+ tracing::info!(self=?self, "Content search params");++ if self.query.trim().is_empty() {+ return Err(ToolCallError {+ description: "query must not be empty".to_string(),+ internal_error: anyhow::anyhow!("query must not be empty"),+ });+ }++ let search_request = UnifiedSearchRequest {+ query: Some(self.query.to_owned()),+ terms: None,+ match_type: MatchType::Partial,+ filters: None,+ search_on: models_search::SearchOn::Content,+ collapse: Some(true),+ include: self.entity_types.clone(),+ disable_recency: false,+ };++ let response = context+ .search_service_client+ .search_unified(&request_context.user_id, search_request, 0, PAGE_SIZE)+ .await+ .map_err(|e| ToolCallError {+ description: format!("failed to perform content search: {}", e),+ internal_error: e,+ })?;++ Ok(SearchToolResponse {+ results: response.results,+ })+ }+}++#[cfg(test)]+mod tests {+ use super::*;+ use ai::generate_tool_input_schema;+ use ai::tool::types::tool_object::validate_tool_schema;++ #[test]+ fn test_content_search_schema_validation() {+ let schema = generate_tool_input_schema!(ContentSearch);++ let result = validate_tool_schema(&schema);+ assert!(result.is_ok(), "{:?}", result);++ let (name, description) = result.unwrap();+ assert_eq!(+ name, "ContentSearch",+ "Tool name should match the schemars title"+ );+ assert!(+ description.contains("Search for items by their content"),+ "Description should contain expected text"+ );+ }+}diff --git a/rust/cloud-storage/ai_tools/src/search/search_service/mod.rs b/rust/cloud-storage/ai_tools/src/search/search_service/mod.rsnew file mode 100644index 0000000000..7566f6eb67--- /dev/null+++ b/rust/cloud-storage/ai_tools/src/search/search_service/mod.rs@@ -0,0 +1,5 @@+pub mod content;+pub mod name;+pub mod types;+#[allow(unused)]+pub mod unified;diff --git a/rust/cloud-storage/ai_tools/src/search/search_service/name.rs b/rust/cloud-storage/ai_tools/src/search/search_service/name.rsnew file mode 100644index 0000000000..c14ebf384b--- /dev/null+++ b/rust/cloud-storage/ai_tools/src/search/search_service/name.rs@@ -0,0 +1,99 @@+use super::types::{PAGE_SIZE, SearchToolResponse};+use crate::tool_context::{RequestContext, ToolServiceContext};+use ai::tool::{AsyncTool, ToolCallError, ToolResult};+use async_trait::async_trait;+use models_search::{+ MatchType,+ unified::{UnifiedSearchIndex, UnifiedSearchRequest},+};+use schemars::JsonSchema;+use serde::Deserialize;++#[derive(Debug, JsonSchema, Deserialize, Clone)]+#[serde(rename_all = "camelCase")]+#[schemars(+ description = "Search for items by their name or title. For documents, this searches the document name. For emails, this searches the subject line. For chats, this searches the chat title. For projects (folders), this searches the project name. This tool finds items based on what they're called, not their content.",+ title = "NameSearch"+)]+pub struct NameSearch {+ #[schemars(+ description = "The name or title to search for. For emails, this is the subject line. For channels, this can be the channel name or participant names."+ )]+ pub name: String,++ #[schemars(+ description = "Which types of items to search. Leave empty to search all types. Examples: ['documents'], ['emails', 'documents'], ['channels']"+ )]+ #[serde(default)]+ pub entity_types: Vec<UnifiedSearchIndex>,+}++#[async_trait]+impl AsyncTool<ToolServiceContext, RequestContext> for NameSearch {+ type Output = SearchToolResponse;++ #[tracing::instrument(skip_all, fields(user_id=?request_context.user_id), err)]+ async fn call(+ &self,+ context: ToolServiceContext,+ request_context: RequestContext,+ ) -> ToolResult<Self::Output> {+ tracing::info!(self=?self, "Name search params");++ if self.name.trim().is_empty() {+ return Err(ToolCallError {+ description: "name must not be empty".to_string(),+ internal_error: anyhow::anyhow!("name must not be empty"),+ });+ }++ let search_request = UnifiedSearchRequest {+ query: Some(self.name.to_owned()),+ terms: None,+ match_type: MatchType::Partial,+ filters: None,+ search_on: models_search::SearchOn::Name,+ collapse: Some(true),+ include: self.entity_types.clone(),+ disable_recency: false,+ };++ let response = context+ .search_service_client+ .search_unified(&request_context.user_id, search_request, 0, PAGE_SIZE)+ .await+ .map_err(|e| ToolCallError {+ description: format!("failed to perform name search: {}", e),+ internal_error: e,+ })?;++ Ok(SearchToolResponse {+ results: response.results,+ })+ }+}++#[cfg(test)]+mod tests {+ use super::*;+ use ai::generate_tool_input_schema;+ use ai::tool::types::tool_object::validate_tool_schema;++ #[test]+ fn test_name_search_schema_validation() {+ let schema = generate_tool_input_schema!(NameSearch);++ let result = validate_tool_schema(&schema);+ assert!(result.is_ok(), "{:?}", result);++ let (name, description) = result.unwrap();+ assert_eq!(+ name, "NameSearch",+ "Tool name should match the schemars title"+ );+ assert!(+ description.contains("Search for items by their name"),+ "Description should contain expected text"+ );+ }+}diff --git a/rust/cloud-storage/ai_tools/src/search/search_service/types.rs b/rust/cloud-storage/ai_tools/src/search/search_service/types.rsnew file mode 100644index 0000000000..828b1699f6--- /dev/null+++ b/rust/cloud-storage/ai_tools/src/search/search_service/types.rs@@ -0,0 +1,10 @@+use models_search::unified::UnifiedSearchResponseItem;+use schemars::JsonSchema;+use serde::{Deserialize, Serialize};++pub const PAGE_SIZE: i64 = 50;++#[derive(Serialize, Deserialize, Debug, JsonSchema)]+pub struct SearchToolResponse {+ pub results: Vec<UnifiedSearchResponseItem>,+}diff --git a/rust/cloud-storage/ai_tools/src/search/unified.rs b/rust/cloud-storage/ai_tools/src/search/search_service/unified.rssimilarity index 100%rename from rust/cloud-storage/ai_tools/src/search/unified.rsrename to rust/cloud-storage/ai_tools/src/search/search_service/unified.rsdiff --git a/rust/cloud-storage/ai_tools/src/search/anthropic_web_search.rs b/rust/cloud-storage/ai_tools/src/search/web/anthropic_web_search.rssimilarity index 100%rename from rust/cloud-storage/ai_tools/src/search/anthropic_web_search.rsrename to rust/cloud-storage/ai_tools/src/search/web/anthropic_web_search.rsdiff --git a/rust/cloud-storage/ai_tools/src/search/web/mod.rs b/rust/cloud-storage/ai_tools/src/search/web/mod.rsnew file mode 100644index 0000000000..59c62b33a6--- /dev/null+++ b/rust/cloud-storage/ai_tools/src/search/web/mod.rs@@ -0,0 +1,6 @@+/// Schemas for frontend type generation for the builtin claude web search tool+/// <https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool>+/// This tool is built into anthropic so is not included in the toolset / sent in the request+pub mod anthropic_web_search;++pub mod perplexity_search;diff --git a/rust/cloud-storage/ai_tools/src/search/perplexity_search.rs b/rust/cloud-storage/ai_tools/src/search/web/perplexity_search.rssimilarity index 100%rename from rust/cloud-storage/ai_tools/src/search/perplexity_search.rsrename to rust/cloud-storage/ai_tools/src/search/web/perplexity_search.rsdiff --git a/rust/cloud-storage/document_cognition_service/schemas/tools.json b/rust/cloud-storage/document_cognition_service/schemas/tools.jsonindex a65a0d49f3..260faba6c6 100644--- a/rust/cloud-storage/document_cognition_service/schemas/tools.json+++ b/rust/cloud-storage/document_cognition_service/schemas/tools.json@@ -1,1150 +1,1411 @@{"schemas": [{- "name": "ListDocuments",+ "name": "Read","inputSchema": {"additionalProperties": false,- "description": "List documents the user has access to with optional filtering and pagination. Only applies to documents, not emails, AI conversations, chat/slack threads, projects aka folders. This tool returns document metadata including access levels and supports filtering by file type, minimum access level, and pagination. Use this tool to discover and browse documents before using the Read tool to access their content. Prefer using the search tool to search on a specific matching string within the content or the name of the entity.",+ "description": "Read content by ID(s). Supports reading documents, channels, chats, and emails by their respective IDs. Use this tool when you need to retrieve the full content of a specific item(s).\n Channel transcripts only include 300 messages. Use 'messages_since' to see messages in a different time window.","properties": {- "exhaustiveSearch": {+ "contentType": {"additionalProperties": false,- "default": false,- "description": "Exhaustive search to get all results. Defaults to false. Set to true when you need all matching documents, ignoring pagination limits.",- "type": "boolean"+ "description": "The type of content to read. Choose based on the type of content you want to retrieve.",+ "enum": [+ "document",+ "channel",+ "channel-message",+ "chat-thread",+ "chat-message",+ "email-thread",+ "email-message",+ "project"+ ],+ "type": "string"},- "fileTypes": {+ "ids": {"additionalProperties": false,- "description": "Document file types to include. Examples: ['pdf'], ['md', 'txt']. Leave empty to include all document types.",+ "description": "ID(s) of the content to read. IMPORTANT: document, channel-message, chat-message, and email-message content types support MULTIPLE ids! For all other content types (channel, chat-thread, email-thread) provide a single id.","items": {"additionalProperties": false,"type": "string"},- "type": [- "array",- "null"- ]+ "type": "array"},- "minAccessLevel": {+ "messagesSince": {"additionalProperties": false,- "description": "Minimum access level required. Defaults to 'view' if not specified.",- "enum": [- "view",- "comment",- "edit",- "owner",- null- ],+ "description": "A local datetime of the earliest message to include in a channel transcript ex: 2025-11-25 12:00:09 EST, only applicable to channels",+ "format": "date-time","type": ["string","null"]- },- "pageOffset": {- "additionalProperties": false,- "default": 0,- "description": "Page offset for pagination. Default is 0. Use higher values to get subsequent pages of results.",- "format": "int64",- "type": "integer"- },- "pageSize": {- "additionalProperties": false,- "default": 50,- "description": "Number of results per page. Max is 100, default is 50. Use smaller values for focused results.",- "format": "int64",- "type": "integer"}},"required": [- "exhaustiveSearch",- "fileTypes",- "minAccessLevel",- "pageOffset",- "pageSize"+ "contentType",+ "ids",+ "messagesSince"],- "title": "ListDocuments",+ "title": "Read","type": "object"},"outputSchema": {"properties": {- "results": {- "description": "The list results (truncated to `results_returned` limit if applicable)",- "items": {- "properties": {- "access_level": {- "description": "The user's access level to this document",- "enum": [- "view",- "comment",- "edit",- "owner"- ],- "type": "string"- },- "created_at": {- "description": "When the document was created",- "format": "date-time",- "type": "string"- },- "deleted_at": {- "description": "When the document was deleted (null if not deleted)",- "format": "date-time",- "type": [- "string",- "null"- ]- },- "document_id": {- "description": "The document id",- "type": "string"- },- "document_name": {- "description": "The document name",- "type": "string"+ "content": {+ "oneOf": [+ {+ "properties": {+ "documents": {+ "items": {+ "properties": {+ "formattedDocument": {+ "type": "string"+ }+ },+ "required": [+ "formattedDocument"+ ],+ "type": "object"+ },+ "type": "array"+ },+ "type": {+ "const": "documents",+ "type": "string"+ }},- "file_type": {- "description": "The file type of the document",- "type": [- "string",- "null"- ]+ "required": [+ "type",+ "documents"+ ],+ "type": "object"+ },+ {+ "properties": {+ "channel_id": {+ "type": "string"+ },+ "channel_name": {+ "type": [+ "string",+ "null"+ ]+ },+ "transcript": {+ "type": "string"+ },+ "type": {+ "const": "channel",+ "type": "string"+ }},- "owner": {- "description": "The owner of the document",- "type": "string"+ "required": [+ "type",+ "channel_id",+ "transcript"+ ],+ "type": "object"+ },+ {+ "properties": {+ "conversation": {+ "items": {+ "properties": {+ "chat_id": {+ "type": "string"+ },+ "messages": {+ "items": {+ "properties": {+ "attachmentIds": {+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "content": {+ "type": "string"+ },+ "date": {+ "format": "date-time",+ "type": "string"+ }+ },+ "required": [+ "content",+ "date",+ "attachmentIds"+ ],+ "type": "object"+ },+ "type": "array"+ },+ "title": {+ "type": "string"+ }+ },+ "required": [+ "chat_id",+ "title",+ "messages"+ ],+ "type": "object"+ },+ "type": "array"+ },+ "type": {+ "const": "chat",+ "type": "string"+ }},- "project_id": {- "description": "The project id containing the document",- "type": [- "string",- "null"- ]+ "required": [+ "type",+ "conversation"+ ],+ "type": "object"+ },+ {+ "properties": {+ "messages": {+ "items": {+ "properties": {+ "bcc": {+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "cc": {+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "content": {+ "type": "string"+ },+ "messageId": {+ "type": "string"+ },+ "recipients": {+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "sender": {+ "type": "string"+ },+ "sentAt": {+ "format": "date-time",+ "type": [+ "string",+ "null"+ ]+ }+ },+ "required": [+ "messageId",+ "sender",+ "recipients",+ "cc",+ "bcc",+ "content"+ ],+ "type": "object"+ },+ "type": "array"+ },+ "subject": {+ "type": [+ "string",+ "null"+ ]+ },+ "thread_id": {+ "type": "string"+ },+ "type": {+ "const": "email",+ "type": "string"+ }},- "updated_at": {- "description": "When the document was last updated",- "format": "date-time",- "type": "string"- }+ "required": [+ "type",+ "thread_id",+ "messages"+ ],+ "type": "object"},- "required": [- "document_id",- "document_name",- "owner",- "created_at",- "updated_at",- "access_level"- ],- "type": "object"- },- "type": "array"- },- "resultsReturned": {- "description": "The number of results returned",- "format": "uint",- "minimum": 0,- "type": "integer"- },- "totalResults": {- "description": "Total number of results found",- "format": "uint",- "minimum": 0,- "type": "integer"+ {+ "properties": {+ "formatted_preview": {+ "type": "string"+ },+ "type": {+ "const": "itemPreviews",+ "type": "string"+ }+ },+ "required": [+ "type",+ "formatted_preview"+ ],+ "type": "object"+ }+ ]}},"required": [- "results",- "totalResults",- "resultsReturned"+ "content"],- "title": "ListDocumentsResponse",+ "title": "ReadResponse","type": "object"}},{- "name": "MarkdownRewrite",+ "name": "NameSearch","inputSchema": {"additionalProperties": false,- "description": "Instruct an agent to edit a markdown file identified by an id.\n This tool should be used when the user include a markdown file in context and requests a revision or edit to that file",+ "description": "Search for items by their name or title. For documents, this searches the document name. For emails, this searches the subject line. For chats, this searches the chat title. For projects (folders), this searches the project name. This tool finds items based on what they're called, not their content.","properties": {- "instructions": {+ "entityTypes": {"additionalProperties": false,- "description": "Instructions for the revision agent to follow to edit the markdown. These instructions will be provided by the user.",- "type": "string"+ "default": [],+ "description": "Which types of items to search. Leave empty to search all types. Examples: ['documents'], ['emails', 'documents'], ['channels']",+ "items": {+ "additionalProperties": false,+ "enum": [+ "documents",+ "chats",+ "emails",+ "channels",+ "projects"+ ],+ "type": "string"+ },+ "type": "array"},- "markdown_file_id": {+ "name": {"additionalProperties": false,- "description": "The markdown file id to target for editing. This file id will be in your context and labeled as a markdown (md) document",+ "description": "The name or title to search for. For emails, this is the subject line. For channels, this can be the channel name or participant names.","type": "string"}},"required": [- "instructions",- "markdown_file_id"+ "entityTypes",+ "name"],- "title": "MarkdownRewrite",+ "title": "NameSearch","type": "object"},"outputSchema": {- "additionalProperties": false,"properties": {- "diffs": {+ "results": {"items": {- "additionalProperties": false,- "properties": {- "markdown_text": {- "type": "string"- },- "node_key": {- "type": "string"- },- "operation": {- "type": "string"- }- },- "required": [- "operation",- "node_key",- "markdown_text"- ],- "type": "object"- },- "type": "array"- }- },- "required": [- "diffs"- ],- "title": "AIDiffResponse",- "type": "object"- }- },- {- "name": "UnifiedSearch",- "inputSchema": {- "additionalProperties": false,- "description": "Universal search across all content types (documents, emails, AI conversations, chat/slack threads/channels, projects aka folders). This tool will return broad metadata from successful results and/or content matches. Use the Read tool next to read the results from those matches. Only ever refer to documents by name or with a document mention. Never state the id of the document in plaintext. User's are presented with the results of this tool as a UI element so there is no need to enumerate the information found from this tool.",- "properties": {- "exhaustiveSearch": {- "additionalProperties": false,- "default": true,- "description": "Exhaustive search across all results matching the query. Defaults to true. Use false when the user only requires a limitied subset of results to answer the question",- "type": "boolean"- },- "pageOffset": {- "additionalProperties": false,- "default": 0,- "description": "Page offset. Default is 0. Use a higher offset to page through results intelligently. Set exhaustive_search to true to get all results.",- "format": "int64",- "type": "integer"- },- "pageSize": {- "additionalProperties": false,- "default": 10,- "description": "Search count per search type (i.e. applies separately to each of documents, emails, ai_conversations, chats, projects). Max is 100. Default is 10. Does not apply when exhaustive_search is set to true.",- "format": "int64",- "type": "integer"- },- "request": {- "additionalProperties": false,- "description": "Aggregated search request, see individual fields for details",- "properties": {- "filters": {- "additionalProperties": false,- "description": "Search filters for various kinds of items. Set the entire filters property as `null` if you do not have specific filters for a given type, e.g. bcc for email filters.",- "properties": {- "channel": {- "additionalProperties": false,- "description": "Channel filters. `null` to not filter channels searched over.",- "properties": {- "channel_ids": {- "additionalProperties": false,- "description": "Channel IDs to search within. Examples: ['general']. Empty to search all accessible channels.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"- },- "mentions": {- "additionalProperties": false,- "description": "Channel user mentions to search for. Examples: ['@username']. Empty if not filtering by mentions.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"- },- "org_id": {- "additionalProperties": false,- "description": "Channel organization ID to search within. Empty to ignore organization filtering.",- "format": "int64",- "type": [- "integer",- "null"- ]+ "oneOf": [+ {+ "description": "DocumentSearchResponseItem object with document metadata we fetch from macrodb. we don't store these\ntimestamps in opensearch as they would require us to update document page record\nevery time the document updates (specifically for updated_at and viewed_at)",+ "properties": {+ "document_id": {+ "description": "The id of the document",+ "format": "uuid",+ "type": "string"+ },+ "document_name": {+ "description": "The name of the document",+ "type": "string"+ },+ "document_search_results": {+ "description": "The search results for the document\nThis may be empty if the search result match was on the document name only",+ "items": {+ "description": "A document match for a given node",+ "properties": {+ "highlight": {+ "description": "The highlights for the document",+ "properties": {+ "bcc": {+ "description": "The highlight match on the bcc (email only)",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "cc": {+ "description": "The highlight match on the cc (email only)",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "content": {+ "description": "The highlight match on the content field",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "name": {+ "description": "The highlight match on the name field",+ "type": [+ "string",+ "null"+ ]+ },+ "recipients": {+ "description": "The highlight match on the recipients (email only)",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "sender": {+ "description": "The highlight match on the sender (email only)",+ "type": [+ "string",+ "null"+ ]+ },+ "user_id": {+ "description": "The highlight match on the user (owner) of the entity",+ "type": [+ "string",+ "null"+ ]+ }+ },+ "type": "object"+ },+ "node_id": {+ "description": "The node id for the document.\nThis is only useful for markdown at the moment\nThis will only be provided if the match was on content",+ "type": [+ "string",+ "null"+ ]+ },+ "raw_content": {+ "description": "The raw content of the document.\nThis is only included for markdown files and will be the raw json node of the match",+ "type": [+ "string",+ "null"+ ]+ },+ "score": {+ "description": "The score of the result",+ "format": "double",+ "type": [+ "number",+ "null"+ ]+ }+ },+ "required": [+ "highlight"+ ],+ "type": "object"},- "sender_ids": {- "additionalProperties": false,- "description": "Sender IDs to search within. Examples: ['user1']. Empty to search all accessible senders.",- "items": {- "additionalProperties": false,- "type": "string"+ "type": "array"+ },+ "file_type": {+ "description": "The file type of the document",+ "type": [+ "string",+ "null"+ ]+ },+ "id": {+ "description": "Standardized fields that all item types will share.\nThese field names are being aligned across all item types\nfor consistency in our data model.",+ "format": "uuid",+ "type": "string"+ },+ "metadata": {+ "description": "Metadata from the database. None if the document doesn't exist in the database.",+ "properties": {+ "created_at": {+ "format": "int64",+ "type": "integer"},- "type": "array"- },- "thread_ids": {- "additionalProperties": false,- "description": "Channel thread IDs to search within. Examples: ['thread123']. Empty to search all threads.",- "items": {- "additionalProperties": false,- "type": "string"+ "deleted_at": {+ "format": "int64",+ "type": [+ "integer",+ "null"+ ]},- "type": "array"- }- },- "required": [- "channel_ids",- "mentions",- "org_id",- "sender_ids",- "thread_ids"- ],- "type": [- "object",- "null"- ]- },- "chat": {- "additionalProperties": false,- "description": "Chat filters. `null` to not filter chats searched over.",- "properties": {- "chat_ids": {- "additionalProperties": false,- "description": "Chat ids to search over. Examples: ['chat1'], ['chat1', 'chat2']. When provided, chat search will only match results on these chats. Empty to search all accessible chats.",- "items": {- "additionalProperties": false,- "type": "string"+ "project_id": {+ "type": [+ "string",+ "null"+ ]},- "type": "array"- },- "owners": {- "additionalProperties": false,- "description": "Filter by chat owner. Examples: ['macro|[email protected]'], ['macro|[email protected]', 'macro|[email protected]']. Empty to search all owners.",- "items": {- "additionalProperties": false,- "type": "string"+ "updated_at": {+ "format": "int64",+ "type": "integer"},- "type": "array"+ "viewed_at": {+ "format": "int64",+ "type": [+ "integer",+ "null"+ ]+ }},- "project_ids": {- "additionalProperties": false,- "description": "A list of project ids to search within. Examples: ['project1']. Empty to ignore project filtering.",- "items": {- "additionalProperties": false,- "type": "string"+ "required": [+ "created_at",+ "updated_at"+ ],+ "type": [+ "object",+ "null"+ ]+ },+ "name": {+ "type": "string"+ },+ "owner_id": {+ "type": "string"+ },+ "sub_type": {+ "anyOf": [+ {+ "description": "The document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.",+ "oneOf": [+ {+ "const": "task",+ "description": "A task document",+ "type": "string"+ }+ ]},- "type": "array"+ {+ "type": "null"+ }+ ],+ "description": "The sub type of the document if present."+ },+ "type": {+ "const": "document",+ "type": "string"+ }+ },+ "required": [+ "type",+ "id",+ "name",+ "owner_id",+ "document_id",+ "document_name",+ "document_search_results"+ ],+ "type": "object"+ },+ {+ "description": "ChatSearchResponse object with channel metadata we fetch from macrodb. we don't store these\ntimestamps in opensearch as they would require us to update each chat message record for the chat\nevery time the chat updates (specifically for updated_at and viewed_at)",+ "properties": {+ "chat_id": {+ "description": "The id of the chat",+ "format": "uuid",+ "type": "string"+ },+ "chat_search_results": {+ "description": "The search results for the chat\nThis may be empty if the search result match was on the chat title only",+ "items": {+ "description": "A chat match for a given message id",+ "properties": {+ "chat_message_id": {+ "description": "The chat message id for the chat\nThis is only present if the search match was on the chat message content",+ "format": "uuid",+ "type": [+ "string",+ "null"+ ]+ },+ "highlight": {+ "description": "The highlights for the chat message",+ "properties": {+ "bcc": {+ "description": "The highlight match on the bcc (email only)",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "cc": {+ "description": "The highlight match on the cc (email only)",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "content": {+ "description": "The highlight match on the content field",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "name": {+ "description": "The highlight match on the name field",+ "type": [+ "string",+ "null"+ ]+ },+ "recipients": {+ "description": "The highlight match on the recipients (email only)",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "sender": {+ "description": "The highlight match on the sender (email only)",+ "type": [+ "string",+ "null"+ ]+ },+ "user_id": {+ "description": "The highlight match on the user (owner) of the entity",+ "type": [+ "string",+ "null"+ ]+ }+ },+ "type": "object"+ },+ "role": {+ "description": "The role of the chat message\nThis is only present if the search match was on the chat message content",+ "type": [+ "string",+ "null"+ ]+ },+ "score": {+ "description": "The score of the result",+ "format": "double",+ "type": [+ "number",+ "null"+ ]+ }+ },+ "required": [+ "highlight"+ ],+ "type": "object"},- "role": {- "additionalProperties": false,- "description": "Chat message roles to search. Examples: ['user'], ['assistant']. Empty to search all roles.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"- }+ "type": "array"},- "required": [- "chat_ids",- "owners",- "project_ids",- "role"- ],- "type": [- "object",- "null"- ]- },- "document": {- "additionalProperties": false,- "description": "Document filters. `null` to not filter documents searched over.",- "properties": {- "document_ids": {- "additionalProperties": false,- "description": "Document ids to search over. Examples: ['doc1'], ['doc1', 'doc2']. Empty to search all accessible documents.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"- },- "file_types": {- "additionalProperties": false,- "description": "Document file types to search. Examples: ['pdf'], ['md', 'txt']. Empty to search all file types.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"- },- "owners": {- "additionalProperties": false,- "description": "Filter by document owner. Examples: ['macro|[email protected]'], ['macro|[email protected]', 'macro|[email protected]']. Empty to search all owners.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"- },- "project_ids": {- "additionalProperties": false,- "description": "A list of project ids to search within. Examples: ['project1'].\nfiltering. Empty to ignore project filtering.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"- }+ "id": {+ "description": "Standardized fields that all item types will share.\nThese field names are being aligned across all item types\nfor consistency in our data model.",+ "format": "uuid",+ "type": "string"},- "required": [- "document_ids",- "file_types",- "owners",- "project_ids"- ],- "type": [- "object",- "null"- ]- },- "email": {- "additionalProperties": false,- "description": "Email filters. `null` to not filter emails searched over.",- "properties": {- "bcc": {- "additionalProperties": false,- "description": "Email BCC addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by BCC.",- "items": {- "additionalProperties": false,- "type": "string"+ "metadata": {+ "description": "Metadata from the database. None if the chat doesn't exist in the database.",+ "properties": {+ "created_at": {+ "format": "int64",+ "type": "integer"},- "type": "array"- },- "cc": {- "additionalProperties": false,- "description": "Email CC addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by CC.",- "items": {- "additionalProperties": false,- "type": "string"+ "deleted_at": {+ "format": "int64",+ "type": [+ "integer",+ "null"+ ]},- "type": "array"- },- "recipients": {- "additionalProperties": false,- "description": "Email Recipient addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by Recipient.",- "items": {- "additionalProperties": false,- "type": "string"+ "project_id": {+ "type": [+ "string",+ "null"+ ]},- "type": "array"- },- "senders": {- "additionalProperties": false,- "description": "Email sender addresses to filter by. Examples: ['[email protected]']. Empty to search all senders.",- "items": {- "additionalProperties": false,- "type": "string"+ "updated_at": {+ "format": "int64",+ "type": "integer"},- "type": "array"- }+ "viewed_at": {+ "format": "int64",+ "type": [+ "integer",+ "null"+ ]+ }+ },+ "required": [+ "created_at",+ "updated_at"+ ],+ "type": [+ "object",+ "null"+ ]},- "required": [- "bcc",- "cc",- "recipients",- "senders"- ],- "type": [- "object",- "null"- ]+ "name": {+ "type": "string"+ },+ "owner_id": {+ "type": "string"+ },+ "type": {+ "const": "chat",+ "type": "string"+ },+ "user_id": {+ "description": "The id of the creator of the chat",+ "type": "string"+ }},- "project": {- "additionalProperties": false,- "description": "Project filters. `null` to not filter projects searched over.",- "properties": {- "owners": {- "additionalProperties": false,- "description": "Filter by project owner. Examples: ['macro|[email protected]'], ['macro|[email protected]', 'macro|[email protected]']. Empty to search all owners.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"+ "required": [+ "type",+ "id",+ "name",+ "owner_id",+ "chat_id",+ "user_id",+ "chat_search_results"+ ],+ "type": "object"+ },+ {+ "description": "EmailSearchResponseItem object with email metadata we fetch from email service. we don't store these\ntimestamps in opensearch as they would require us to update each email message record for the thread\nevery time the thread updates (specifically for updated_at and viewed_at)",+ "properties": {+ "created_at": {+ "format": "int64",+ "type": "integer"+ },+ "email_message_search_results": {+ "description": "The search results for the document\nThis may be empty if the search result match was on the email subject only",+ "items": {+ "description": "A email message match for a given thread id",+ "properties": {+ "bcc": {+ "description": "This is only present if the search result is on the message content",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "cc": {+ "description": "This is only present if the search result is on the message content",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "highlight": {+ "description": "The highlights for the email message",+ "properties": {+ "bcc": {+ "description": "The highlight match on the bcc (email only)",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "cc": {+ "description": "The highlight match on the cc (email only)",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "content": {+ "description": "The highlight match on the content field",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "name": {+ "description": "The highlight match on the name field",+ "type": [+ "string",+ "null"+ ]+ },+ "recipients": {+ "description": "The highlight match on the recipients (email only)",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "sender": {+ "description": "The highlight match on the sender (email only)",+ "type": [+ "string",+ "null"+ ]+ },+ "user_id": {+ "description": "The highlight match on the user (owner) of the entity",+ "type": [+ "string",+ "null"+ ]+ }+ },+ "type": "object"+ },+ "labels": {+ "description": "This is only present if the search result is on the message content",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "message_id": {+ "description": "The email message id.\nThis is only present if the search result is on the message content",+ "format": "uuid",+ "type": [+ "string",+ "null"+ ]+ },+ "pretty_sender": {+ "description": "The pretty sender.\nIf the match is on the subject, the pretty sender is the latest sender on the thread.\nThis could be the sender's email if there is no contact name for the sender.",+ "type": "string"+ },+ "recipients": {+ "description": "This is only present if the search result is on the message content",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "score": {+ "description": "The score of the result",+ "format": "double",+ "type": [+ "number",+ "null"+ ]+ },+ "sender": {+ "description": "The sender.\nIf the match is on the subject, the sender is the latest sender on the thread.",+ "type": "string"+ },+ "sent_at": {+ "description": "When the email message was sent\nThis is only present if the search result is on the message content",+ "format": "int64",+ "type": [+ "integer",+ "null"+ ]+ }+ },+ "required": [+ "sender",+ "pretty_sender",+ "recipients",+ "cc",+ "bcc",+ "labels",+ "highlight"+ ],+ "type": "object"},- "project_ids": {- "additionalProperties": false,- "description": "Project IDs to search within. Examples: ['project1']. Empty to search all accessible projects.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"- }+ "type": "array"},- "required": [- "owners",- "project_ids"- ],- "type": [- "object",- "null"- ]- }- },- "required": [- "channel",- "chat",- "document",- "email",- "project"- ],- "type": [- "object",- "null"- ]- },- "include": {- "additionalProperties": false,- "default": [],- "description": "Include specific entity types from search. If empty, all entity types will be searched over. If you are unsure which types to search, use an empty array to search all.",- "items": {- "additionalProperties": false,- "enum": [- "documents",- "chats",- "emails",- "channels",- "projects"+ "id": {+ "description": "Standardized fields that all item types will share.\nThese field names are being aligned across all item types\nfor consistency in our data model.",+ "format": "uuid",+ "type": "string"+ },+ "name": {+ "description": "Subject of the email thread",+ "type": [+ "string",+ "null"+ ]+ },+ "owner_id": {+ "type": "string"+ },+ "snippet": {+ "type": [+ "string",+ "null"+ ]+ },+ "subject": {+ "description": "The subject of the email\nThis is only present if the search result is on the message content",+ "type": [+ "string",+ "null"+ ]+ },+ "thread_id": {+ "description": "The id of the email thread",+ "format": "uuid",+ "type": "string"+ },+ "type": {+ "const": "email",+ "type": "string"+ },+ "updated_at": {+ "format": "int64",+ "type": "integer"+ },+ "user_id": {+ "description": "The id of the owner of the email thread",+ "type": "string"+ },+ "viewed_at": {+ "format": "int64",+ "type": [+ "integer",+ "null"+ ]+ }+ },+ "required": [+ "type",+ "created_at",+ "updated_at",+ "id",+ "owner_id",+ "thread_id",+ "user_id",+ "email_message_search_results"],- "type": "string"- },- "type": "array"- },- "match_type": {- "additionalProperties": false,- "description": "How to match the search terms. 'exact' for precise case-sensitive phrase matches, 'partial' for prefix/partial matches. REQUIRED field.",- "enum": [- "exact",- "partial",- "regexp"- ],- "type": "string"- },- "search_on": {- "additionalProperties": false,- "default": "content",- "description": "Fields to search on (Name, Content, NameContent). Defaults to Content",- "enum": [- "name",- "content",- "name_content"- ],- "type": "string"- },- "terms": {- "additionalProperties": false,- "description": "Multiple distinct search terms as separate strings. Use this for keyword-based searches where you want to find content containing any of these terms. Each term must be at least 3 characters (shorter terms are automatically filtered out). Examples: ['machine', 'learning', 'algorithms'], ['project', 'status', 'update']. `null` this field if searching without text terms to search all. This field matches query string against both name and content.",- "items": {- "additionalProperties": false,- "type": "string"+ "type": "object"},- "type": [- "array",- "null"- ]- }- },- "required": [- "filters",- "include",- "match_type",- "search_on",- "terms"- ],- "type": "object"- }- },- "required": [- "exhaustiveSearch",- "pageOffset",- "pageSize",- "request"- ],- "title": "UnifiedSearch",- "type": "object"- },- "outputSchema": {- "properties": {- "response": {- "description": "The search results",- "properties": {- "results": {- "description": "The search results (truncated to `results_returned` limit if applicable)",- "items": {- "oneOf": [- {- "description": "DocumentSearchResponseItem object with document metadata we fetch from macrodb. we don't store these\ntimestamps in opensearch as they would require us to update document page record\nevery time the document updates (specifically for updated_at and viewed_at)",- "properties": {- "document_id": {- "description": "The id of the document",- "format": "uuid",- "type": "string"- },- "document_name": {- "description": "The name of the document",- "type": "string"- },- "document_search_results": {- "description": "The search results for the document\nThis may be empty if the search result match was on the document name only",- "items": {- "description": "A document match for a given node",+ {+ "description": "ChannelSearchResponseItem object with channel metadata we fetch from macrodb. we don't store these\ntimestamps in opensearch as they would require us to update each chat message record for the chat\nevery time the chat updates (specifically for updated_at and viewed_at and interacted_at)",+ "properties": {+ "channel_id": {+ "description": "The id of the channel",+ "format": "uuid",+ "type": "string"+ },+ "channel_message_search_results": {+ "description": "The search results for the channel\nThis may be empty if the search result match was not on content",+ "items": {+ "description": "A channel message match for a given channel id",+ "properties": {+ "created_at": {+ "description": "When the channel message was created\nThis is only prsent if the search result is on the message content",+ "format": "int64",+ "type": [+ "integer",+ "null"+ ]+ },+ "highlight": {+ "description": "The highlights for the channel message","properties": {- "highlight": {- "description": "The highlights for the document",- "properties": {- "bcc": {- "description": "The highlight match on the bcc (email only)",- "items": {- "type": "string"- },- "type": "array"- },- "cc": {- "description": "The highlight match on the cc (email only)",- "items": {- "type": "string"- },- "type": "array"- },- "content": {- "description": "The highlight match on the content field",- "items": {- "type": "string"- },- "type": "array"- },- "name": {- "description": "The highlight match on the name field",- "type": [- "string",- "null"- ]- },- "recipients": {- "description": "The highlight match on the recipients (email only)",- "items": {- "type": "string"- },- "type": "array"- },- "sender": {- "description": "The highlight match on the sender (email only)",- "type": [- "string",- "null"- ]- },- "user_id": {- "description": "The highlight match on the user (owner) of the entity",- "type": [- "string",- "null"- ]- }+ "bcc": {+ "description": "The highlight match on the bcc (email only)",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "cc": {+ "description": "The highlight match on the cc (email only)",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "content": {+ "description": "The highlight match on the content field",+ "items": {+ "type": "string"},- "type": "object"+ "type": "array"},- "node_id": {- "description": "The node id for the document.\nThis is only useful for markdown at the moment\nThis will only be provided if the match was on content",+ "name": {+ "description": "The highlight match on the name field","type": ["string","null"]},- "raw_content": {- "description": "The raw content of the document.\nThis is only included for markdown files and will be the raw json node of the match",+ "recipients": {+ "description": "The highlight match on the recipients (email only)",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "sender": {+ "description": "The highlight match on the sender (email only)","type": ["string","null"]},- "score": {- "description": "The score of the result",- "format": "double",+ "user_id": {+ "description": "The highlight match on the user (owner) of the entity","type": [- "number",+ "string","null"]}},- "required": [- "highlight"- ],"type": "object"},- "type": "array"+ "message_id": {+ "description": "The channel message id\nThis is only prsent if the search result is on the message content",+ "format": "uuid",+ "type": [+ "string",+ "null"+ ]+ },+ "score": {+ "description": "The score of the result",+ "format": "double",+ "type": [+ "number",+ "null"+ ]+ },+ "sender_id": {+ "description": "The sender id\nThis is only prsent if the search result is on the message content",+ "type": [+ "string",+ "null"+ ]+ },+ "thread_id": {+ "description": "The channel message thread id",+ "format": "uuid",+ "type": [+ "string",+ "null"+ ]+ },+ "updated_at": {+ "description": "When the channel message was last updated\nThis is only prsent if the search result is on the message content",+ "format": "int64",+ "type": [+ "integer",+ "null"+ ]+ }+ },+ "required": [+ "highlight"+ ],+ "type": "object"+ },+ "type": "array"+ },+ "channel_type": {+ "description": "The type of channel",+ "type": "string"+ },+ "id": {+ "description": "Standardized fields that all item types will share.\nThese field names are being aligned across all item types\nfor consistency in our data model.",+ "format": "uuid",+ "type": "string"+ },+ "metadata": {+ "description": "Metadata from the database. None if the channel doesn't exist in the database.",+ "properties": {+ "created_at": {+ "format": "int64",+ "type": "integer"},- "file_type": {- "description": "The file type of the document",+ "interacted_at": {+ "format": "int64","type": [- "string",+ "integer","null"]},- "id": {- "description": "Standardized fields that all item types will share.\nThese field names are being aligned across all item types\nfor consistency in our data model.",- "format": "uuid",- "type": "string"+ "updated_at": {+ "format": "int64",+ "type": "integer"},- "metadata": {- "description": "Metadata from the database. None if the document doesn't exist in the database.",- "properties": {- "created_at": {- "format": "int64",- "type": "integer"- },- "deleted_at": {- "format": "int64",- "type": [- "integer",- "null"- ]- },- "project_id": {- "type": [- "string",- "null"- ]- },- "updated_at": {- "format": "int64",- "type": "integer"- },- "viewed_at": {- "format": "int64",- "type": [- "integer",- "null"- ]- }- },- "required": [- "created_at",- "updated_at"- ],+ "viewed_at": {+ "format": "int64","type": [- "object",+ "integer","null"]+ }+ },+ "required": [+ "created_at",+ "updated_at"+ ],+ "type": [+ "object",+ "null"+ ]+ },+ "owner_id": {+ "description": "we don't store this for channels atm but keeping it here for consistency",+ "type": [+ "string",+ "null"+ ]+ },+ "type": {+ "const": "channel",+ "type": "string"+ }+ },+ "required": [+ "type",+ "id",+ "channel_type",+ "channel_id",+ "channel_message_search_results"+ ],+ "type": "object"+ },+ {+ "description": "ProjectSearchResponseItem object with project metadata we fetch from macrodb. we don't store these\ntimestamps in opensearch as they would require us to update the project record\nevery time the project updates (specifically for updated_at and viewed_at)",+ "properties": {+ "created_at": {+ "format": "int64",+ "type": "integer"+ },+ "id": {+ "description": "Standardized fields that all item types will share.\nThese field names are being aligned across all item types\nfor consistency in our data model.",+ "format": "uuid",+ "type": "string"+ },+ "metadata": {+ "description": "Metadata from the database. None if the project doesn't exist in the database.",+ "properties": {+ "created_at": {+ "format": "int64",+ "type": "integer"},- "name": {- "type": "string"+ "deleted_at": {+ "format": "int64",+ "type": [+ "integer",+ "null"+ ]},- "owner_id": {- "type": "string"+ "parent_project_id": {+ "type": [+ "string",+ "null"+ ]},- "sub_type": {- "anyOf": [- {- "description": "The document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.",- "oneOf": [- {- "const": "task",- "description": "A task document",- "type": "string"- }- ]- },- {- "type": "null"- }- ],- "description": "The sub type of the document if present."+ "updated_at": {+ "format": "int64",+ "type": "integer"},- "type": {- "const": "document",- "type": "string"+ "viewed_at": {+ "format": "int64",+ "type": [+ "integer",+ "null"+ ]}},"required": [- "type",- "id",- "name",- "owner_id",- "document_id",- "document_name",- "document_search_results"+ "created_at",+ "updated_at"],- "type": "object"+ "type": [+ "object",+ "null"+ ]},- {- "description": "ChatSearchResponse object with channel metadata we fetch from macrodb. we don't store these\ntimestamps in opensearch as they would require us to update each chat message record for the chat\nevery time the chat updates (specifically for updated_at and viewed_at)",- "properties": {- "chat_id": {- "description": "The id of the chat",- "format": "uuid",- "type": "string"- },- "chat_search_results": {- "description": "The search results for the chat\nThis may be empty if the search result match was on the chat title only",- "items": {- "description": "A chat match for a given message id",+ "name": {+ "type": "string"+ },+ "owner_id": {+ "type": "string"+ },+ "project_search_results": {+ "items": {+ "properties": {+ "highlight": {"properties": {- "chat_message_id": {- "description": "The chat message id for the chat\nThis is only present if the search match was on the chat message content",- "format": "uuid",+ "bcc": {+ "description": "The highlight match on the bcc (email only)",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "cc": {+ "description": "The highlight match on the cc (email only)",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "content": {+ "description": "The highlight match on the content field",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "name": {+ "description": "The highlight match on the name field","type": ["string","null"]},- "highlight": {- "description": "The highlights for the chat message",- "properties": {- "bcc": {- "description": "The highlight match on the bcc (email only)",- "items": {- "type": "string"- },- "type": "array"- },- "cc": {- "description": "The highlight match on the cc (email only)",- "items": {- "type": "string"- },- "type": "array"- },- "content": {- "description": "The highlight match on the content field",- "items": {- "type": "string"- },- "type": "array"- },- "name": {- "description": "The highlight match on the name field",- "type": [- "string",- "null"- ]- },- "recipients": {- "description": "The highlight match on the recipients (email only)",- "items": {- "type": "string"- },- "type": "array"- },- "sender": {- "description": "The highlight match on the sender (email only)",- "type": [- "string",- "null"- ]- },- "user_id": {- "description": "The highlight match on the user (owner) of the entity",- "type": [- "string",- "null"- ]- }+ "recipients": {+ "description": "The highlight match on the recipients (email only)",+ "items": {+ "type": "string"},- "type": "object"+ "type": "array"},- "role": {- "description": "The role of the chat message\nThis is only present if the search match was on the chat message content",+ "sender": {+ "description": "The highlight match on the sender (email only)","type": ["string","null"]},- "score": {- "description": "The score of the result",- "format": "double",+ "user_id": {+ "description": "The highlight match on the user (owner) of the entity","type": [- "number",+ "string","null"]}},- "required": [- "highlight"- ],"type": "object"},- "type": "array"- },- "id": {- "description": "Standardized fields that all item types will share.\nThese field names are being aligned across all item types\nfor consistency in our data model.",- "format": "uuid",- "type": "string"- },- "metadata": {- "description": "Metadata from the database. None if the chat doesn't exist in the database.",- "properties": {- "created_at": {- "format": "int64",- "type": "integer"- },- "deleted_at": {- "format": "int64",- "type": [- "integer",- "null"- ]- },- "project_id": {- "type": [- "string",- "null"- ]- },- "updated_at": {- "format": "int64",- "type": "integer"- },- "viewed_at": {- "format": "int64",- "type": [- "integer",- "null"- ]- }- },- "required": [- "created_at",- "updated_at"- ],- "type": [- "object",- "null"- ]- },- "name": {- "type": "string"- },- "owner_id": {- "type": "string"- },- "type": {- "const": "chat",- "type": "string"- },- "user_id": {- "description": "The id of the creator of the chat",- "type": "string"- }+ "score": {+ "description": "The score of the result",+ "format": "double",+ "type": [+ "number",+ "null"+ ]+ }+ },+ "required": [+ "highlight"+ ],+ "type": "object"},- "required": [- "type",- "id",- "name",- "owner_id",- "chat_id",- "user_id",- "chat_search_results"- ],- "type": "object"+ "type": "array"},- {- "description": "EmailSearchResponseItem object with email metadata we fetch from email service. we don't store these\ntimestamps in opensearch as they would require us to update each email message record for the thread\nevery time the thread updates (specifically for updated_at and viewed_at)",- "properties": {- "created_at": {- "format": "int64",- "type": "integer"- },- "email_message_search_results": {- "description": "The search results for the document\nThis may be empty if the search result match was on the email subject only",- "items": {- "description": "A email message match for a given thread id",+ "type": {+ "const": "project",+ "type": "string"+ },+ "updated_at": {+ "format": "int64",+ "type": "integer"+ }+ },+ "required": [+ "type",+ "id",+ "name",+ "owner_id",+ "updated_at",+ "created_at",+ "project_search_results"+ ],+ "type": "object"+ }+ ]+ },+ "type": "array"+ }+ },+ "required": [+ "results"+ ],+ "title": "SearchToolResponse",+ "type": "object"+ }+ },+ {+ "name": "ContentSearch",+ "inputSchema": {+ "additionalProperties": false,+ "description": "Search for items by their content. For documents, this searches the document body text. For emails, this searches the email message body. For chats, this searches the message content. This tool finds items based on what's inside them, not their titles or names.",+ "properties": {+ "entityTypes": {+ "additionalProperties": false,+ "default": [],+ "description": "Which types of items to search. Leave empty to search all types. Examples: ['documents'], ['emails', 'documents'], ['channels']",+ "items": {+ "additionalProperties": false,+ "enum": [+ "documents",+ "chats",+ "emails",+ "channels",+ "projects"+ ],+ "type": "string"+ },+ "type": "array"+ },+ "query": {+ "additionalProperties": false,+ "description": "The text content to search for. This searches within the body of documents, emails, and messages.",+ "type": "string"+ }+ },+ "required": [+ "entityTypes",+ "query"+ ],+ "title": "ContentSearch",+ "type": "object"+ },+ "outputSchema": {+ "properties": {+ "results": {+ "items": {+ "oneOf": [+ {+ "description": "DocumentSearchResponseItem object with document metadata we fetch from macrodb. we don't store these\ntimestamps in opensearch as they would require us to update document page record\nevery time the document updates (specifically for updated_at and viewed_at)",+ "properties": {+ "document_id": {+ "description": "The id of the document",+ "format": "uuid",+ "type": "string"+ },+ "document_name": {+ "description": "The name of the document",+ "type": "string"+ },+ "document_search_results": {+ "description": "The search results for the document\nThis may be empty if the search result match was on the document name only",+ "items": {+ "description": "A document match for a given node",+ "properties": {+ "highlight": {+ "description": "The highlights for the document","properties": {"bcc": {- "description": "This is only present if the search result is on the message content",+ "description": "The highlight match on the bcc (email only)","items": {"type": "string"},"type": "array"},"cc": {- "description": "This is only present if the search result is on the message content",+ "description": "The highlight match on the cc (email only)","items": {"type": "string"},"type": "array"},- "highlight": {- "description": "The highlights for the email message",- "properties": {- "bcc": {- "description": "The highlight match on the bcc (email only)",- "items": {- "type": "string"- },- "type": "array"- },- "cc": {- "description": "The highlight match on the cc (email only)",- "items": {- "type": "string"- },- "type": "array"- },- "content": {- "description": "The highlight match on the content field",- "items": {- "type": "string"- },- "type": "array"- },- "name": {- "description": "The highlight match on the name field",- "type": [- "string",- "null"- ]- },- "recipients": {- "description": "The highlight match on the recipients (email only)",- "items": {- "type": "string"- },- "type": "array"- },- "sender": {- "description": "The highlight match on the sender (email only)",- "type": [- "string",- "null"- ]- },- "user_id": {- "description": "The highlight match on the user (owner) of the entity",- "type": [- "string",- "null"- ]- }- },- "type": "object"- },- "labels": {- "description": "This is only present if the search result is on the message content",+ "content": {+ "description": "The highlight match on the content field","items": {"type": "string"},"type": "array"},- "message_id": {- "description": "The email message id.\nThis is only present if the search result is on the message content",- "format": "uuid",+ "name": {+ "description": "The highlight match on the name field","type": ["string","null"]},- "pretty_sender": {- "description": "The pretty sender.\nIf the match is on the subject, the pretty sender is the latest sender on the thread.\nThis could be the sender's email if there is no contact name for the sender.",- "type": "string"- },"recipients": {- "description": "This is only present if the search result is on the message content",+ "description": "The highlight match on the recipients (email only)","items": {"type": "string"},"type": "array"},- "score": {- "description": "The score of the result",- "format": "double",+ "sender": {+ "description": "The highlight match on the sender (email only)","type": [- "number",+ "string","null"]},- "sender": {- "description": "The sender.\nIf the match is on the subject, the sender is the latest sender on the thread.",- "type": "string"- },- "sent_at": {- "description": "When the email message was sent\nThis is only present if the search result is on the message content",- "format": "int64",+ "user_id": {+ "description": "The highlight match on the user (owner) of the entity","type": [- "integer",+ "string","null"]}},- "required": [- "sender",- "pretty_sender",- "recipients",- "cc",- "bcc",- "labels",- "highlight"- ],"type": "object"},- "type": "array"- },- "id": {- "description": "Standardized fields that all item types will share.\nThese field names are being aligned across all item types\nfor consistency in our data model.",- "format": "uuid",- "type": "string"- },- "name": {- "description": "Subject of the email thread",- "type": [- "string",- "null"- ]- },- "owner_id": {- "type": "string"+ "node_id": {+ "description": "The node id for the document.\nThis is only useful for markdown at the moment\nThis will only be provided if the match was on content",+ "type": [+ "string",+ "null"+ ]+ },+ "raw_content": {+ "description": "The raw content of the document.\nThis is only included for markdown files and will be the raw json node of the match",+ "type": [+ "string",+ "null"+ ]+ },+ "score": {+ "description": "The score of the result",+ "format": "double",+ "type": [+ "number",+ "null"+ ]+ }+ },+ "required": [+ "highlight"+ ],+ "type": "object"+ },+ "type": "array"+ },+ "file_type": {+ "description": "The file type of the document",+ "type": [+ "string",+ "null"+ ]+ },+ "id": {+ "description": "Standardized fields that all item types will share.\nThese field names are being aligned across all item types\nfor consistency in our data model.",+ "format": "uuid",+ "type": "string"+ },+ "metadata": {+ "description": "Metadata from the database. None if the document doesn't exist in the database.",+ "properties": {+ "created_at": {+ "format": "int64",+ "type": "integer"},- "snippet": {+ "deleted_at": {+ "format": "int64","type": [- "string",+ "integer","null"]},- "subject": {- "description": "The subject of the email\nThis is only present if the search result is on the message content",+ "project_id": {"type": ["string","null"]},- "thread_id": {- "description": "The id of the email thread",- "format": "uuid",- "type": "string"- },- "type": {- "const": "email",- "type": "string"- },"updated_at": {"format": "int64","type": "integer"},- "user_id": {- "description": "The id of the owner of the email thread",- "type": "string"- },"viewed_at": {"format": "int64","type": [@@ -1154,688 +1415,838 @@}},"required": [- "type","created_at",- "updated_at",- "id",- "owner_id",- "thread_id",- "user_id",- "email_message_search_results"+ "updated_at"],- "type": "object"+ "type": [+ "object",+ "null"+ ]},- {- "description": "ChannelSearchResponseItem object with channel metadata we fetch from macrodb. we don't store these\ntimestamps in opensearch as they would require us to update each chat message record for the chat\nevery time the chat updates (specifically for updated_at and viewed_at and interacted_at)",- "properties": {- "channel_id": {- "description": "The id of the channel",- "format": "uuid",- "type": "string"+ "name": {+ "type": "string"+ },+ "owner_id": {+ "type": "string"+ },+ "sub_type": {+ "anyOf": [+ {+ "description": "The document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.",+ "oneOf": [+ {+ "const": "task",+ "description": "A task document",+ "type": "string"+ }+ ]},- "channel_message_search_results": {- "description": "The search results for the channel\nThis may be empty if the search result match was not on content",- "items": {- "description": "A channel message match for a given channel id",+ {+ "type": "null"+ }+ ],+ "description": "The sub type of the document if present."+ },+ "type": {+ "const": "document",+ "type": "string"+ }+ },+ "required": [+ "type",+ "id",+ "name",+ "owner_id",+ "document_id",+ "document_name",+ "document_search_results"+ ],+ "type": "object"+ },+ {+ "description": "ChatSearchResponse object with channel metadata we fetch from macrodb. we don't store these\ntimestamps in opensearch as they would require us to update each chat message record for the chat\nevery time the chat updates (specifically for updated_at and viewed_at)",+ "properties": {+ "chat_id": {+ "description": "The id of the chat",+ "format": "uuid",+ "type": "string"+ },+ "chat_search_results": {+ "description": "The search results for the chat\nThis may be empty if the search result match was on the chat title only",+ "items": {+ "description": "A chat match for a given message id",+ "properties": {+ "chat_message_id": {+ "description": "The chat message id for the chat\nThis is only present if the search match was on the chat message content",+ "format": "uuid",+ "type": [+ "string",+ "null"+ ]+ },+ "highlight": {+ "description": "The highlights for the chat message","properties": {- "created_at": {- "description": "When the channel message was created\nThis is only prsent if the search result is on the message content",- "format": "int64",- "type": [- "integer",- "null"- ]+ "bcc": {+ "description": "The highlight match on the bcc (email only)",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "cc": {+ "description": "The highlight match on the cc (email only)",+ "items": {+ "type": "string"+ },+ "type": "array"},- "highlight": {- "description": "The highlights for the channel message",- "properties": {- "bcc": {- "description": "The highlight match on the bcc (email only)",- "items": {- "type": "string"- },- "type": "array"- },- "cc": {- "description": "The highlight match on the cc (email only)",- "items": {- "type": "string"- },- "type": "array"- },- "content": {- "description": "The highlight match on the content field",- "items": {- "type": "string"- },- "type": "array"- },- "name": {- "description": "The highlight match on the name field",- "type": [- "string",- "null"- ]- },- "recipients": {- "description": "The highlight match on the recipients (email only)",- "items": {- "type": "string"- },- "type": "array"- },- "sender": {- "description": "The highlight match on the sender (email only)",- "type": [- "string",- "null"- ]- },- "user_id": {- "description": "The highlight match on the user (owner) of the entity",- "type": [- "string",- "null"- ]- }+ "content": {+ "description": "The highlight match on the content field",+ "items": {+ "type": "string"},- "type": "object"+ "type": "array"},- "message_id": {- "description": "The channel message id\nThis is only prsent if the search result is on the message content",- "format": "uuid",+ "name": {+ "description": "The highlight match on the name field","type": ["string","null"]},- "score": {- "description": "The score of the result",- "format": "double",- "type": [- "number",- "null"- ]+ "recipients": {+ "description": "The highlight match on the recipients (email only)",+ "items": {+ "type": "string"+ },+ "type": "array"},- "sender_id": {- "description": "The sender id\nThis is only prsent if the search result is on the message content",+ "sender": {+ "description": "The highlight match on the sender (email only)","type": ["string","null"]},- "thread_id": {- "description": "The channel message thread id",- "format": "uuid",+ "user_id": {+ "description": "The highlight match on the user (owner) of the entity","type": ["string","null"]- },- "updated_at": {- "description": "When the channel message was last updated\nThis is only prsent if the search result is on the message content",- "format": "int64",- "type": [- "integer",- "null"- ]}},- "required": [- "highlight"- ],"type": "object"},- "type": "array"- },- "channel_type": {- "description": "The type of channel",- "type": "string"- },- "id": {- "description": "Standardized fields that all item types will share.\nThese field names are being aligned across all item types\nfor consistency in our data model.",- "format": "uuid",- "type": "string"- },- "metadata": {- "description": "Metadata from the database. None if the channel doesn't exist in the database.",- "properties": {- "created_at": {- "format": "int64",- "type": "integer"- },- "interacted_at": {- "format": "int64",- "type": [- "integer",- "null"- ]- },- "updated_at": {- "format": "int64",- "type": "integer"- },- "viewed_at": {- "format": "int64",- "type": [- "integer",- "null"- ]- }+ "role": {+ "description": "The role of the chat message\nThis is only present if the search match was on the chat message content",+ "type": [+ "string",+ "null"+ ]},- "required": [- "created_at",- "updated_at"- ],+ "score": {+ "description": "The score of the result",+ "format": "double",+ "type": [+ "number",+ "null"+ ]+ }+ },+ "required": [+ "highlight"+ ],+ "type": "object"+ },+ "type": "array"+ },+ "id": {+ "description": "Standardized fields that all item types will share.\nThese field names are being aligned across all item types\nfor consistency in our data model.",+ "format": "uuid",+ "type": "string"+ },+ "metadata": {+ "description": "Metadata from the database. None if the chat doesn't exist in the database.",+ "properties": {+ "created_at": {+ "format": "int64",+ "type": "integer"+ },+ "deleted_at": {+ "format": "int64","type": [- "object",+ "integer","null"]},- "owner_id": {- "description": "we don't store this for channels atm but keeping it here for consistency",+ "project_id": {"type": ["string","null"]},- "type": {- "const": "channel",- "type": "string"+ "updated_at": {+ "format": "int64",+ "type": "integer"+ },+ "viewed_at": {+ "format": "int64",+ "type": [+ "integer",+ "null"+ ]}},"required": [- "type",- "id",- "channel_type",- "channel_id",- "channel_message_search_results"+ "created_at",+ "updated_at"],- "type": "object"+ "type": [+ "object",+ "null"+ ]},- {- "description": "ProjectSearchResponseItem object with project metadata we fetch from macrodb. we don't store these\ntimestamps in opensearch as they would require us to update the project record\nevery time the project updates (specifically for updated_at and viewed_at)",- "properties": {- "created_at": {- "format": "int64",- "type": "integer"- },- "id": {- "description": "Standardized fields that all item types will share.\nThese field names are being aligned across all item types\nfor consistency in our data model.",- "format": "uuid",- "type": "string"- },- "metadata": {- "description": "Metadata from the database. None if the project doesn't exist in the database.",- "properties": {- "created_at": {- "format": "int64",- "type": "integer"- },- "deleted_at": {- "format": "int64",- "type": [- "integer",- "null"- ]- },- "parent_project_id": {- "type": [- "string",- "null"- ]+ "name": {+ "type": "string"+ },+ "owner_id": {+ "type": "string"+ },+ "type": {+ "const": "chat",+ "type": "string"+ },+ "user_id": {+ "description": "The id of the creator of the chat",+ "type": "string"+ }+ },+ "required": [+ "type",+ "id",+ "name",+ "owner_id",+ "chat_id",+ "user_id",+ "chat_search_results"+ ],+ "type": "object"+ },+ {+ "description": "EmailSearchResponseItem object with email metadata we fetch from email service. we don't store these\ntimestamps in opensearch as they would require us to update each email message record for the thread\nevery time the thread updates (specifically for updated_at and viewed_at)",+ "properties": {+ "created_at": {+ "format": "int64",+ "type": "integer"+ },+ "email_message_search_results": {+ "description": "The search results for the document\nThis may be empty if the search result match was on the email subject only",+ "items": {+ "description": "A email message match for a given thread id",+ "properties": {+ "bcc": {+ "description": "This is only present if the search result is on the message content",+ "items": {+ "type": "string"},- "updated_at": {- "format": "int64",- "type": "integer"+ "type": "array"+ },+ "cc": {+ "description": "This is only present if the search result is on the message content",+ "items": {+ "type": "string"},- "viewed_at": {- "format": "int64",- "type": [- "integer",- "null"- ]- }+ "type": "array"},- "required": [- "created_at",- "updated_at"- ],- "type": [- "object",- "null"- ]- },- "name": {- "type": "string"- },- "owner_id": {- "type": "string"- },- "project_search_results": {- "items": {+ "highlight": {+ "description": "The highlights for the email message","properties": {- "highlight": {- "properties": {- "bcc": {- "description": "The highlight match on the bcc (email only)",- "items": {- "type": "string"- },- "type": "array"- },- "cc": {- "description": "The highlight match on the cc (email only)",- "items": {- "type": "string"- },- "type": "array"- },- "content": {- "description": "The highlight match on the content field",- "items": {- "type": "string"- },- "type": "array"- },- "name": {- "description": "The highlight match on the name field",- "type": [- "string",- "null"- ]- },- "recipients": {- "description": "The highlight match on the recipients (email only)",- "items": {- "type": "string"- },- "type": "array"- },- "sender": {- "description": "The highlight match on the sender (email only)",- "type": [- "string",- "null"- ]- },- "user_id": {- "description": "The highlight match on the user (owner) of the entity",- "type": [- "string",- "null"- ]- }+ "bcc": {+ "description": "The highlight match on the bcc (email only)",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "cc": {+ "description": "The highlight match on the cc (email only)",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "content": {+ "description": "The highlight match on the content field",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "name": {+ "description": "The highlight match on the name field",+ "type": [+ "string",+ "null"+ ]+ },+ "recipients": {+ "description": "The highlight match on the recipients (email only)",+ "items": {+ "type": "string"},- "type": "object"+ "type": "array"+ },+ "sender": {+ "description": "The highlight match on the sender (email only)",+ "type": [+ "string",+ "null"+ ]},- "score": {- "description": "The score of the result",- "format": "double",+ "user_id": {+ "description": "The highlight match on the user (owner) of the entity","type": [- "number",+ "string","null"]}},- "required": [- "highlight"- ],"type": "object"},- "type": "array"- },- "type": {- "const": "project",- "type": "string"- },- "updated_at": {- "format": "int64",- "type": "integer"- }- },- "required": [- "type",- "id",- "name",- "owner_id",- "updated_at",- "created_at",- "project_search_results"- ],- "type": "object"- }- ]- },- "type": "array"- },- "resultsReturned": {- "description": "the number of results returned",- "format": "uint",- "minimum": 0,- "type": "integer"- },- "totalResults": {- "description": "total number of results from search",- "format": "uint",- "minimum": 0,- "type": "integer"- }- },- "required": [- "results",- "totalResults",- "resultsReturned"- ],- "type": "object"- },- "responseSchema": {- "description": "The JSON schema for the response so the LLM can understand it"- }- },- "required": [- "response",- "responseSchema"- ],- "title": "UnifiedSearchResponseOutput",- "type": "object"- }- },- {- "name": "Read",- "inputSchema": {- "additionalProperties": false,- "description": "Read content by ID(s). Supports reading documents, channels, chats, and emails by their respective IDs. Use this tool when you need to retrieve the full content of a specific item(s).\n Channel transcripts only include 300 messages. Use 'messages_since' to see messages in a different time window.",- "properties": {- "contentType": {- "additionalProperties": false,- "description": "The type of content to read. Choose based on the type of content you want to retrieve.",- "enum": [- "document",- "channel",- "channel-message",- "chat-thread",- "chat-message",- "email-thread",- "email-message",- "project"- ],- "type": "string"- },- "ids": {- "additionalProperties": false,- "description": "ID(s) of the content to read. IMPORTANT: document, channel-message, chat-message, and email-message content types support MULTIPLE ids! For all other content types (channel, chat-thread, email-thread) provide a single id.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"- },- "messagesSince": {- "additionalProperties": false,- "description": "A local datetime of the earliest message to include in a channel transcript ex: 2025-11-25 12:00:09 EST, only applicable to channels",- "format": "date-time",- "type": [- "string",- "null"- ]- }- },- "required": [- "contentType",- "ids",- "messagesSince"- ],- "title": "Read",- "type": "object"- },- "outputSchema": {- "properties": {- "content": {- "oneOf": [- {- "properties": {- "documents": {- "items": {- "properties": {- "content": {- "type": "string"- },- "documentId": {- "type": "string"- },- "metadata": {- "properties": {- "deleted": {- "type": "boolean"- },- "documentName": {- "type": "string"- },- "fileType": {- "type": [- "string",- "null"- ]- },- "owner": {+ "labels": {+ "description": "This is only present if the search result is on the message content",+ "items": {"type": "string"},- "projectId": {- "type": [- "string",- "null"- ]- }+ "type": "array"},- "required": [- "documentName",- "owner",- "deleted"- ],- "type": "object"- }- },- "required": [- "documentId",- "content",- "metadata"- ],- "type": "object"- },- "type": "array"- },- "type": {- "const": "documents",- "type": "string"- }- },- "required": [- "type",- "documents"- ],- "type": "object"- },- {- "properties": {- "channel_id": {- "type": "string"- },- "channel_name": {- "type": [- "string",- "null"- ]- },- "transcript": {- "type": "string"+ "message_id": {+ "description": "The email message id.\nThis is only present if the search result is on the message content",+ "format": "uuid",+ "type": [+ "string",+ "null"+ ]+ },+ "pretty_sender": {+ "description": "The pretty sender.\nIf the match is on the subject, the pretty sender is the latest sender on the thread.\nThis could be the sender's email if there is no contact name for the sender.",+ "type": "string"+ },+ "recipients": {+ "description": "This is only present if the search result is on the message content",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "score": {+ "description": "The score of the result",+ "format": "double",+ "type": [+ "number",+ "null"+ ]+ },+ "sender": {+ "description": "The sender.\nIf the match is on the subject, the sender is the latest sender on the thread.",+ "type": "string"+ },+ "sent_at": {+ "description": "When the email message was sent\nThis is only present if the search result is on the message content",+ "format": "int64",+ "type": [+ "integer",+ "null"+ ]+ }+ },+ "required": [+ "sender",+ "pretty_sender",+ "recipients",+ "cc",+ "bcc",+ "labels",+ "highlight"+ ],+ "type": "object"+ },+ "type": "array"+ },+ "id": {+ "description": "Standardized fields that all item types will share.\nThese field names are being aligned across all item types\nfor consistency in our data model.",+ "format": "uuid",+ "type": "string"+ },+ "name": {+ "description": "Subject of the email thread",+ "type": [+ "string",+ "null"+ ]+ },+ "owner_id": {+ "type": "string"+ },+ "snippet": {+ "type": [+ "string",+ "null"+ ]+ },+ "subject": {+ "description": "The subject of the email\nThis is only present if the search result is on the message content",+ "type": [+ "string",+ "null"+ ]+ },+ "thread_id": {+ "description": "The id of the email thread",+ "format": "uuid",+ "type": "string"+ },+ "type": {+ "const": "email",+ "type": "string"+ },+ "updated_at": {+ "format": "int64",+ "type": "integer"+ },+ "user_id": {+ "description": "The id of the owner of the email thread",+ "type": "string"+ },+ "viewed_at": {+ "format": "int64",+ "type": [+ "integer",+ "null"+ ]+ }},- "type": {- "const": "channel",- "type": "string"- }+ "required": [+ "type",+ "created_at",+ "updated_at",+ "id",+ "owner_id",+ "thread_id",+ "user_id",+ "email_message_search_results"+ ],+ "type": "object"},- "required": [- "type",- "channel_id",- "transcript"- ],- "type": "object"- },- {- "properties": {- "conversation": {- "items": {- "properties": {- "chat_id": {- "type": "string"- },- "messages": {- "items": {+ {+ "description": "ChannelSearchResponseItem object with channel metadata we fetch from macrodb. we don't store these\ntimestamps in opensearch as they would require us to update each chat message record for the chat\nevery time the chat updates (specifically for updated_at and viewed_at and interacted_at)",+ "properties": {+ "channel_id": {+ "description": "The id of the channel",+ "format": "uuid",+ "type": "string"+ },+ "channel_message_search_results": {+ "description": "The search results for the channel\nThis may be empty if the search result match was not on content",+ "items": {+ "description": "A channel message match for a given channel id",+ "properties": {+ "created_at": {+ "description": "When the channel message was created\nThis is only prsent if the search result is on the message content",+ "format": "int64",+ "type": [+ "integer",+ "null"+ ]+ },+ "highlight": {+ "description": "The highlights for the channel message","properties": {- "attachmentIds": {+ "bcc": {+ "description": "The highlight match on the bcc (email only)",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "cc": {+ "description": "The highlight match on the cc (email only)","items": {"type": "string"},"type": "array"},"content": {- "type": "string"+ "description": "The highlight match on the content field",+ "items": {+ "type": "string"+ },+ "type": "array"},- "date": {- "format": "date-time",- "type": "string"+ "name": {+ "description": "The highlight match on the name field",+ "type": [+ "string",+ "null"+ ]+ },+ "recipients": {+ "description": "The highlight match on the recipients (email only)",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "sender": {+ "description": "The highlight match on the sender (email only)",+ "type": [+ "string",+ "null"+ ]+ },+ "user_id": {+ "description": "The highlight match on the user (owner) of the entity",+ "type": [+ "string",+ "null"+ ]}},- "required": [- "content",- "date",- "attachmentIds"- ],"type": "object"},- "type": "array"+ "message_id": {+ "description": "The channel message id\nThis is only prsent if the search result is on the message content",+ "format": "uuid",+ "type": [+ "string",+ "null"+ ]+ },+ "score": {+ "description": "The score of the result",+ "format": "double",+ "type": [+ "number",+ "null"+ ]+ },+ "sender_id": {+ "description": "The sender id\nThis is only prsent if the search result is on the message content",+ "type": [+ "string",+ "null"+ ]+ },+ "thread_id": {+ "description": "The channel message thread id",+ "format": "uuid",+ "type": [+ "string",+ "null"+ ]+ },+ "updated_at": {+ "description": "When the channel message was last updated\nThis is only prsent if the search result is on the message content",+ "format": "int64",+ "type": [+ "integer",+ "null"+ ]+ }+ },+ "required": [+ "highlight"+ ],+ "type": "object"+ },+ "type": "array"+ },+ "channel_type": {+ "description": "The type of channel",+ "type": "string"+ },+ "id": {+ "description": "Standardized fields that all item types will share.\nThese field names are being aligned across all item types\nfor consistency in our data model.",+ "format": "uuid",+ "type": "string"+ },+ "metadata": {+ "description": "Metadata from the database. None if the channel doesn't exist in the database.",+ "properties": {+ "created_at": {+ "format": "int64",+ "type": "integer"},- "title": {- "type": "string"+ "interacted_at": {+ "format": "int64",+ "type": [+ "integer",+ "null"+ ]+ },+ "updated_at": {+ "format": "int64",+ "type": "integer"+ },+ "viewed_at": {+ "format": "int64",+ "type": [+ "integer",+ "null"+ ]}},"required": [- "chat_id",- "title",- "messages"+ "created_at",+ "updated_at"],- "type": "object"+ "type": [+ "object",+ "null"+ ]},- "type": "array"+ "owner_id": {+ "description": "we don't store this for channels atm but keeping it here for consistency",+ "type": [+ "string",+ "null"+ ]+ },+ "type": {+ "const": "channel",+ "type": "string"+ }},- "type": {- "const": "chat",- "type": "string"- }+ "required": [+ "type",+ "id",+ "channel_type",+ "channel_id",+ "channel_message_search_results"+ ],+ "type": "object"},- "required": [- "type",- "conversation"- ],- "type": "object"- },- {- "properties": {- "messages": {- "items": {+ {+ "description": "ProjectSearchResponseItem object with project metadata we fetch from macrodb. we don't store these\ntimestamps in opensearch as they would require us to update the project record\nevery time the project updates (specifically for updated_at and viewed_at)",+ "properties": {+ "created_at": {+ "format": "int64",+ "type": "integer"+ },+ "id": {+ "description": "Standardized fields that all item types will share.\nThese field names are being aligned across all item types\nfor consistency in our data model.",+ "format": "uuid",+ "type": "string"+ },+ "metadata": {+ "description": "Metadata from the database. None if the project doesn't exist in the database.","properties": {- "bcc": {- "items": {- "type": "string"- },- "type": "array"- },- "cc": {- "items": {- "type": "string"- },- "type": "array"- },- "content": {- "type": "string"+ "created_at": {+ "format": "int64",+ "type": "integer"},- "messageId": {- "type": "string"+ "deleted_at": {+ "format": "int64",+ "type": [+ "integer",+ "null"+ ]},- "recipients": {- "items": {- "type": "string"- },- "type": "array"+ "parent_project_id": {+ "type": [+ "string",+ "null"+ ]},- "sender": {- "type": "string"+ "updated_at": {+ "format": "int64",+ "type": "integer"},- "sentAt": {- "format": "date-time",+ "viewed_at": {+ "format": "int64","type": [- "string",+ "integer","null"]}},"required": [- "messageId",- "sender",- "recipients",- "cc",- "bcc",- "content"+ "created_at",+ "updated_at"],- "type": "object"+ "type": [+ "object",+ "null"+ ]},- "type": "array"- },- "subject": {- "type": [- "string",- "null"- ]- },- "thread_id": {- "type": "string"+ "name": {+ "type": "string"+ },+ "owner_id": {+ "type": "string"+ },+ "project_search_results": {+ "items": {+ "properties": {+ "highlight": {+ "properties": {+ "bcc": {+ "description": "The highlight match on the bcc (email only)",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "cc": {+ "description": "The highlight match on the cc (email only)",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "content": {+ "description": "The highlight match on the content field",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "name": {+ "description": "The highlight match on the name field",+ "type": [+ "string",+ "null"+ ]+ },+ "recipients": {+ "description": "The highlight match on the recipients (email only)",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "sender": {+ "description": "The highlight match on the sender (email only)",+ "type": [+ "string",+ "null"+ ]+ },+ "user_id": {+ "description": "The highlight match on the user (owner) of the entity",+ "type": [+ "string",+ "null"+ ]+ }+ },+ "type": "object"+ },+ "score": {+ "description": "The score of the result",+ "format": "double",+ "type": [+ "number",+ "null"+ ]+ }+ },+ "required": [+ "highlight"+ ],+ "type": "object"+ },+ "type": "array"+ },+ "type": {+ "const": "project",+ "type": "string"+ },+ "updated_at": {+ "format": "int64",+ "type": "integer"+ }},- "type": {- "const": "email",- "type": "string"- }+ "required": [+ "type",+ "id",+ "name",+ "owner_id",+ "updated_at",+ "created_at",+ "project_search_results"+ ],+ "type": "object"+ }+ ]+ },+ "type": "array"+ }+ },+ "required": [+ "results"+ ],+ "title": "SearchToolResponse",+ "type": "object"+ }+ },+ {+ "name": "MarkdownRewrite",+ "inputSchema": {+ "additionalProperties": false,+ "description": "Instruct an agent to edit a markdown file identified by an id.\n This tool should be used when the user include a markdown file in context and requests a revision or edit to that file",+ "properties": {+ "instructions": {+ "additionalProperties": false,+ "description": "Instructions for the revision agent to follow to edit the markdown. These instructions will be provided by the user.",+ "type": "string"+ },+ "markdown_file_id": {+ "additionalProperties": false,+ "description": "The markdown file id to target for editing. This file id will be in your context and labeled as a markdown (md) document",+ "type": "string"+ }+ },+ "required": [+ "instructions",+ "markdown_file_id"+ ],+ "title": "MarkdownRewrite",+ "type": "object"+ },+ "outputSchema": {+ "additionalProperties": false,+ "properties": {+ "diffs": {+ "items": {+ "additionalProperties": false,+ "properties": {+ "markdown_text": {+ "type": "string"},- "required": [- "type",- "thread_id",- "messages"- ],- "type": "object"- },- {- "properties": {- "formatted_preview": {- "type": "string"- },- "type": {- "const": "itemPreviews",- "type": "string"- }+ "node_key": {+ "type": "string"},- "required": [- "type",- "formatted_preview"- ],- "type": "object"- }- ]+ "operation": {+ "type": "string"+ }+ },+ "required": [+ "operation",+ "node_key",+ "markdown_text"+ ],+ "type": "object"+ },+ "type": "array"}},"required": [- "content"+ "diffs"],- "title": "ReadResponse",+ "title": "AIDiffResponse","type": "object"}},@@ -2253,6 +2664,165 @@"type": "object"}},+ {+ "name": "ListDocuments",+ "inputSchema": {+ "additionalProperties": false,+ "description": "List documents the user has access to with optional filtering and pagination. Only applies to documents, not emails, AI conversations, chat/slack threads, projects aka folders. This tool returns document metadata including access levels and supports filtering by file type, minimum access level, and pagination. Use this tool to discover and browse documents before using the Read tool to access their content. Prefer using the search tool to search on a specific matching string within the content or the name of the entity.",+ "properties": {+ "exhaustiveSearch": {+ "additionalProperties": false,+ "default": false,+ "description": "Exhaustive search to get all results. Defaults to false. Set to true when you need all matching documents, ignoring pagination limits.",+ "type": "boolean"+ },+ "fileTypes": {+ "additionalProperties": false,+ "description": "Document file types to include. Examples: ['pdf'], ['md', 'txt']. Leave empty to include all document types.",+ "items": {+ "additionalProperties": false,+ "type": "string"+ },+ "type": [+ "array",+ "null"+ ]+ },+ "minAccessLevel": {+ "additionalProperties": false,+ "description": "Minimum access level required. Defaults to 'view' if not specified.",+ "enum": [+ "view",+ "comment",+ "edit",+ "owner",+ null+ ],+ "type": [+ "string",+ "null"+ ]+ },+ "pageOffset": {+ "additionalProperties": false,+ "default": 0,+ "description": "Page offset for pagination. Default is 0. Use higher values to get subsequent pages of results.",+ "format": "int64",+ "type": "integer"+ },+ "pageSize": {+ "additionalProperties": false,+ "default": 50,+ "description": "Number of results per page. Max is 100, default is 50. Use smaller values for focused results.",+ "format": "int64",+ "type": "integer"+ }+ },+ "required": [+ "exhaustiveSearch",+ "fileTypes",+ "minAccessLevel",+ "pageOffset",+ "pageSize"+ ],+ "title": "ListDocuments",+ "type": "object"+ },+ "outputSchema": {+ "properties": {+ "results": {+ "description": "The list results (truncated to `results_returned` limit if applicable)",+ "items": {+ "properties": {+ "access_level": {+ "description": "The user's access level to this document",+ "enum": [+ "view",+ "comment",+ "edit",+ "owner"+ ],+ "type": "string"+ },+ "created_at": {+ "description": "When the document was created",+ "format": "date-time",+ "type": "string"+ },+ "deleted_at": {+ "description": "When the document was deleted (null if not deleted)",+ "format": "date-time",+ "type": [+ "string",+ "null"+ ]+ },+ "document_id": {+ "description": "The document id",+ "type": "string"+ },+ "document_name": {+ "description": "The document name",+ "type": "string"+ },+ "file_type": {+ "description": "The file type of the document",+ "type": [+ "string",+ "null"+ ]+ },+ "owner": {+ "description": "The owner of the document",+ "type": "string"+ },+ "project_id": {+ "description": "The project id containing the document",+ "type": [+ "string",+ "null"+ ]+ },+ "updated_at": {+ "description": "When the document was last updated",+ "format": "date-time",+ "type": "string"+ }+ },+ "required": [+ "document_id",+ "document_name",+ "owner",+ "created_at",+ "updated_at",+ "access_level"+ ],+ "type": "object"+ },+ "type": "array"+ },+ "resultsReturned": {+ "description": "The number of results returned",+ "format": "uint",+ "minimum": 0,+ "type": "integer"+ },+ "totalResults": {+ "description": "Total number of results found",+ "format": "uint",+ "minimum": 0,+ "type": "integer"+ }+ },+ "required": [+ "results",+ "totalResults",+ "resultsReturned"+ ],+ "title": "ListDocumentsResponse",+ "type": "object"+ }+ },{"name": "web_search","inputSchema": {diff --git a/rust/cloud-storage/models_search/src/simple.rs b/rust/cloud-storage/models_search/src/simple.rsindex f57ab582f5..d968099b0c 100644--- a/rust/cloud-storage/models_search/src/simple.rs+++ b/rust/cloud-storage/models_search/src/simple.rs@@ -97,6 +97,7 @@ impl From<opensearch_client::search::model::SearchGotoContent> for SearchGotoCon/// Simple response item to mimic what we get back from opensearch#[derive(Debug, serde::Serialize, serde::Deserialize, ToSchema, JsonSchema)]pub struct SimpleSearchResponseItem {+ /// ID of the chat, channel, email, or documentpub entity_id: uuid::Uuid,pub entity_type: String,pub score: Option<f64>,