Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat(dcs): batch id support for read tool (#399)

Eric Hayes1c14f2786746
diff --git a/js/app/packages/service-cognition/generated/tools/schemas.ts b/js/app/packages/service-cognition/generated/tools/schemas.ts
index 1dc9f381d0..3285ce7e03 100644
--- a/js/app/packages/service-cognition/generated/tools/schemas.ts
+++ b/js/app/packages/service-cognition/generated/tools/schemas.ts
@@ -13,7 +13,7 @@ export const ListDocumentsOutputSchema = z.object({ "results": z.array(z.object(
export const ListEmailsInputSchema = z.object({ "cursor": z.union([z.string(), z.null()]).default(null), "limit": z.number().int().default(20), "sortMethod": z.enum(["viewed_at","updated_at","created_at","viewed_updated"]).default("viewed_at"), "view": z.object({ "standardLabel": z.union([z.literal("Inbox"), z.literal("Sent"), z.literal("Drafts"), z.literal("Starred"), z.literal("All"), z.literal("Important"), z.literal("Other"), z.literal(null)]), "userLabel": z.union([z.string(), z.null()]) }).strict().default({"standardLabel":null,"userLabel":null}) }).strict()
-export const ListEmailsOutputSchema = z.object({ "items": z.array(z.object({ "attachments": z.array(z.object({ "contentId": z.union([z.string(), z.null()]).optional(), "createdAt": z.number().int(), "filename": z.union([z.string(), z.null()]).optional(), "id": z.string().uuid(), "messageId": z.string().uuid(), "mimeType": z.union([z.string(), z.null()]).optional(), "providerAttachmentId": z.union([z.string(), z.null()]).optional(), "sizeBytes": z.union([z.number().int(), z.null()]).optional() })), "contacts": z.array(z.object({ "emailAddress": z.union([z.string(), z.null()]).optional(), "id": z.string().uuid(), "linkId": z.string().uuid(), "name": z.union([z.string(), z.null()]).optional(), "sfsPhotoUrl": z.union([z.string(), z.null()]).optional() })), "createdAt": z.number().int(), "frecencyScore": z.union([z.number(), z.null()]).optional(), "id": z.string().uuid(), "inboxVisible": z.boolean(), "isDraft": z.boolean(), "isImportant": z.boolean(), "isRead": z.boolean(), "macroAttachments": z.array(z.object({ "dbId": z.string().uuid(), "itemId": z.string().uuid(), "itemType": z.string(), "messageId": z.string().uuid() })), "name": z.union([z.string(), z.null()]).optional(), "ownerId": z.string(), "providerId": z.union([z.string(), z.null()]).optional(), "senderEmail": z.union([z.string(), z.null()]).optional(), "senderName": z.union([z.string(), z.null()]).optional(), "senderPhotoUrl": z.union([z.string(), z.null()]).optional(), "snippet": z.union([z.string(), z.null()]).optional(), "sortTs": z.number().int(), "updatedAt": z.number().int(), "viewedAt": z.union([z.number().int(), z.null()]).optional() })), "next_cursor": z.union([z.string(), z.null()]).optional() })
+export const ListEmailsOutputSchema = z.object({ "items": z.array(z.object({ "attachments": z.array(z.object({ "contentId": z.union([z.string(), z.null()]).optional(), "createdAt": z.number().int(), "filename": z.union([z.string(), z.null()]).optional(), "id": z.string().uuid(), "messageId": z.string().uuid(), "mimeType": z.union([z.string(), z.null()]).optional(), "providerAttachmentId": z.union([z.string(), z.null()]).optional(), "sizeBytes": z.union([z.number().int(), z.null()]).optional() })), "contacts": z.array(z.object({ "emailAddress": z.union([z.string(), z.null()]).optional(), "id": z.string().uuid(), "linkId": z.string().uuid(), "name": z.union([z.string(), z.null()]).optional(), "sfsPhotoUrl": z.union([z.string(), z.null()]).optional() })), "createdAt": z.number().int(), "frecencyScore": z.union([z.number(), z.null()]).optional(), "id": z.string().uuid(), "inboxVisible": z.boolean(), "isDraft": z.boolean(), "isImportant": z.boolean(), "isRead": z.boolean(), "labels": z.array(z.object({ "createdAt": z.string().datetime({ offset: true }), "id": z.string().uuid(), "labelListVisibility": z.enum(["LabelShow","LabelShowIfUnread","LabelHide"]), "linkId": z.string().uuid(), "messageListVisibility": z.enum(["Show","Hide"]), "name": z.string(), "providerLabelId": z.string(), "type": z.enum(["System","User"]) })), "macroAttachments": z.array(z.object({ "dbId": z.string().uuid(), "itemId": z.string().uuid(), "itemType": z.string(), "messageId": z.string().uuid() })), "name": z.union([z.string(), z.null()]).optional(), "ownerId": z.string(), "providerId": z.union([z.string(), z.null()]).optional(), "senderEmail": z.union([z.string(), z.null()]).optional(), "senderName": z.union([z.string(), z.null()]).optional(), "senderPhotoUrl": z.union([z.string(), z.null()]).optional(), "snippet": z.union([z.string(), z.null()]).optional(), "sortTs": z.number().int(), "updatedAt": z.number().int(), "viewedAt": z.union([z.number().int(), z.null()]).optional() })), "next_cursor": z.union([z.string(), z.null()]).optional() })
export const MarkdownRewriteInputSchema = z.object({ "instructions": z.string(), "markdown_file_id": z.string() }).strict()
@@ -26,7 +26,7 @@ export const ReadInputSchema = z.object({ "contentType": z.enum(["document","cha
export const ReadOutputSchema = z.object({ "content": z.any().superRefine((x, ctx) => {
- const schemas = [z.object({ "content": z.string(), "document_id": z.string(), "metadata": z.object({ "deleted": z.boolean(), "documentName": z.string(), "fileType": z.union([z.string(), z.null()]).optional(), "owner": z.string(), "projectId": z.union([z.string(), z.null()]).optional() }), "type": z.literal("document") }), 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({ "documents": z.array(z.object({ "content": z.string(), "documentId": z.string(), "metadata": z.object({ "deleted": z.boolean(), "documentName": z.string(), "fileType": z.union([z.string(), z.null()]).optional(), "owner": z.string(), "projectId": z.union([z.string(), z.null()]).optional() }) })), "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) =>
diff --git a/js/app/packages/service-cognition/generated/tools/types.ts b/js/app/packages/service-cognition/generated/tools/types.ts
index 8f1250987d..cbbc9f31b3 100644
--- a/js/app/packages/service-cognition/generated/tools/types.ts
+++ b/js/app/packages/service-cognition/generated/tools/types.ts
@@ -169,6 +169,16 @@ export interface ListEmailsOutput {
isDraft: boolean;
isImportant: boolean;
isRead: boolean;
+ labels: {
+ createdAt: string;
+ id: string;
+ labelListVisibility: 'LabelShow' | 'LabelShowIfUnread' | 'LabelHide';
+ linkId: string;
+ messageListVisibility: 'Show' | 'Hide';
+ name: string;
+ providerLabelId: string;
+ type: 'System' | 'User';
+ }[];
macroAttachments: {
dbId: string;
itemId: string;
@@ -253,7 +263,7 @@ export interface ReadInput {
| 'email-thread'
| 'email-message';
/**
- * ID(s) of the content to read. IMPORTANT: Currently only chat-message content type supports MULTIPLE ids! For all other content types provide a single id.
+ * 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.
*/
ids: string[];
/**
@@ -273,16 +283,18 @@ export interface ReadInput {
export interface ReadOutput {
content:
| {
- content: string;
- document_id: string;
- metadata: {
- deleted: boolean;
- documentName: string;
- fileType?: string | null;
- owner: string;
- projectId?: string | null;
- };
- type: 'document';
+ documents: {
+ content: string;
+ documentId: string;
+ metadata: {
+ deleted: boolean;
+ documentName: string;
+ fileType?: string | null;
+ owner: string;
+ projectId?: string | null;
+ };
+ }[];
+ type: 'documents';
}
| {
channel_id: string;
diff --git a/rust/cloud-storage/ai_tools/src/read.rs b/rust/cloud-storage/ai_tools/src/read.rs
index be0c475f7a..c97c0a52f1 100644
--- a/rust/cloud-storage/ai_tools/src/read.rs
+++ b/rust/cloud-storage/ai_tools/src/read.rs
@@ -22,10 +22,8 @@ pub struct ReadResponse {
#[serde(rename_all = "camelCase")]
#[serde(tag = "type")]
pub enum ReadContent {
- Document {
- document_id: String,
- content: String,
- metadata: DocumentMetadata,
+ Documents {
+ documents: Vec<DocumentItem>,
},
Channel {
channel_id: String,
@@ -53,6 +51,14 @@ pub struct DocumentMetadata {
pub deleted: bool,
}
+#[derive(Debug, JsonSchema, Serialize)]
+#[serde(rename_all = "camelCase")]
+pub struct DocumentItem {
+ pub document_id: String,
+ pub content: String,
+ pub metadata: DocumentMetadata,
+}
+
#[derive(Debug, JsonSchema, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct EmailMessage {
@@ -100,7 +106,7 @@ pub struct Read {
)]
pub content_type: ContentType,
#[schemars(
- description = "ID(s) of the content to read. IMPORTANT: Currently only chat-message content type supports MULTIPLE ids! For all other content types provide a single id."
+ 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."
)]
pub ids: Vec<String>,
#[schemars(
@@ -183,43 +189,52 @@ impl Read {
context: &ToolServiceContext,
request_context: &RequestContext,
) -> Result<ReadContent, ToolCallError> {
- let id = self.provide_single_id()?;
+ let mut documents = Vec::new();
+
+ for id in &self.ids {
+ let document_fetcher = context
+ .scribe
+ .document
+ .fetch_with_auth(id, request_context.jwt_token.clone());
+
+ let document_with_content = match document_fetcher.document_content().await {
+ Ok(doc) => doc,
+ Err(e) => {
+ tracing::warn!("failed to fetch document {}: {}", id, e);
+ continue; // Skip failed documents instead of failing the entire request
+ }
+ };
+
+ let metadata = document_with_content.metadata().clone();
+ let content_str = match document_with_content.content.text_content() {
+ Ok(content) => content,
+ Err(e) => {
+ tracing::warn!("failed to extract text content for document {}: {}", id, e);
+ continue;
+ }
+ };
+
+ documents.push(DocumentItem {
+ document_id: id.clone(),
+ content: content_str,
+ metadata: DocumentMetadata {
+ document_name: metadata.document_name,
+ owner: metadata.owner,
+ file_type: metadata.file_type,
+ project_id: metadata.project_id,
+ deleted: metadata.deleted_at.is_some(),
+ },
+ });
+ }
- let document_fetcher = context
- .scribe
- .document
- .fetch_with_auth(&id, request_context.jwt_token.clone());
+ if documents.is_empty() {
+ return Err(ToolCallError {
+ description: "failed to fetch any documents".to_string(),
+ internal_error: anyhow::anyhow!("all document fetches failed"),
+ });
+ }
- let document_with_content =
- document_fetcher
- .document_content()
- .await
- .map_err(|e| ToolCallError {
- description: format!("failed to fetch document content: {}", e),
- internal_error: e,
- })?;
-
- let metadata = document_with_content.metadata().clone();
- let content_str =
- document_with_content
- .content
- .text_content()
- .map_err(|e| ToolCallError {
- description: format!("failed to extract text content: {}", e),
- internal_error: e,
- })?;
-
- Ok(ReadContent::Document {
- document_id: id,
- content: content_str,
- metadata: DocumentMetadata {
- document_name: metadata.document_name,
- owner: metadata.owner,
- file_type: metadata.file_type,
- project_id: metadata.project_id,
- deleted: metadata.deleted_at.is_some(),
- },
- })
+ Ok(ReadContent::Documents { documents })
}
async fn read_channel(
@@ -272,26 +287,53 @@ impl Read {
context: &ToolServiceContext,
request_context: &RequestContext,
) -> Result<ReadContent, ToolCallError> {
- let id = self.provide_single_id()?;
+ let mut transcripts = Vec::new();
+ let mut channel_id = String::new();
+
+ for id in &self.ids {
+ // Get messages with context
+ let transcript = match context
+ .scribe
+ .channel
+ .get_message_with_context(id.as_str(), 0, 0, &request_context.jwt_token)
+ .await
+ {
+ Ok(t) => t,
+ Err(e) => {
+ tracing::warn!("failed to fetch channel message {}: {}", id, e);
+ continue; // Skip failed messages instead of failing the entire request
+ }
+ };
+
+ // Use the channel_id from the first message
+ if channel_id.is_empty() {
+ channel_id = id.clone();
+ }
- // Get messages with context
- let transcript = context
- .scribe
- .channel
- .get_message_with_context(id.as_str(), 0, 0, &request_context.jwt_token)
- .await
- .map_err(|e| ToolCallError {
- description: format!("failed to fetch channel message with context: {}", e),
- internal_error: e,
- })?;
+ transcripts.push(transcript);
+ }
+
+ if transcripts.is_empty() {
+ return Err(ToolCallError {
+ description: "failed to fetch any channel messages".to_string(),
+ internal_error: anyhow::anyhow!("all channel message fetches failed"),
+ });
+ }
+
+ // Combine transcripts with separators for multiple messages
+ let combined_transcript = if transcripts.len() == 1 {
+ transcripts.into_iter().next().unwrap()
+ } else {
+ transcripts.join("\n\n---\n\n")
+ };
// Note: We don't fetch channel metadata here since the user is focused on a specific message
// The message_id itself doesn't directly give us the channel_id, but the transcript
// includes the conversation context
Ok(ReadContent::Channel {
- channel_id: id,
+ channel_id,
channel_name: None,
- transcript,
+ transcript: combined_transcript,
})
}
@@ -365,24 +407,48 @@ impl Read {
context: &ToolServiceContext,
request_context: &RequestContext,
) -> Result<ReadContent, ToolCallError> {
- let id = self.provide_single_id()?;
- let parsed_message = context
- .scribe
- .email
- .get_email_message_by_id(&id, Some(&request_context.jwt_token))
- .await
- .map_err(|e| ToolCallError {
- description: format!("failed to fetch email message: {}", e),
- internal_error: e,
- })?;
- let subject = parsed_message.subject.clone();
+ let mut email_messages = Vec::new();
+ let mut subject = None;
+ let mut thread_id = String::new();
+
+ for id in &self.ids {
+ let parsed_message = match context
+ .scribe
+ .email
+ .get_email_message_by_id(id, Some(&request_context.jwt_token))
+ .await
+ {
+ Ok(msg) => msg,
+ Err(e) => {
+ tracing::warn!("failed to fetch email message {}: {}", id, e);
+ continue; // Skip failed messages instead of failing the entire request
+ }
+ };
+
+ // Use the subject from the first message
+ if subject.is_none() {
+ subject = parsed_message.subject.clone();
+ }
+
+ // Use the thread_id from the first message
+ if thread_id.is_empty() {
+ thread_id = id.clone();
+ }
+
+ email_messages.push(EmailMessage::from(parsed_message));
+ }
- let email_message = EmailMessage::from(parsed_message);
+ if email_messages.is_empty() {
+ return Err(ToolCallError {
+ description: "failed to fetch any email messages".to_string(),
+ internal_error: anyhow::anyhow!("all email message fetches failed"),
+ });
+ }
Ok(ReadContent::Email {
- thread_id: id,
+ thread_id,
subject,
- messages: vec![email_message],
+ messages: email_messages,
})
}
}
diff --git a/rust/cloud-storage/document_cognition_service/schemas/tools.json b/rust/cloud-storage/document_cognition_service/schemas/tools.json
index b2ec4e588e..89def84e0b 100644
--- a/rust/cloud-storage/document_cognition_service/schemas/tools.json
+++ b/rust/cloud-storage/document_cognition_service/schemas/tools.json
@@ -1,5 +1,55 @@
{
"schemas": [
+ {
+ "name": "WebSearch",
+ "inputSchema": {
+ "additionalProperties": false,
+ "description": "Trigger an intelligent internet search tool with a search query. Phrase the query as a natural language question. The search tool only has the information passed into the query string to include any relevant context from the conversation. Use this tool when the user specifically requests a web search, asks for resources, asks for links, asks you to read documentationWhen referencing links returned by search remember to use github markdown notation to format them like this [description](https://example.com)Our CEO describes when to use web search like this: I think some important criteria for choosing to search the web are\",\n if the user is asking for time-sensitive information (sports scores, news, current happenings, etc) that would have changed since the knowledge cutoff date\n Specific questions that reference external sources, eg contain a hyperlink in the user message or explicitly say “use webmd” or “check arxiv”\n do not use web search for things that are likely to find SEO slop content; this will make it worse than if it didn’t do it\n the LLM is be allowed to guess an answer and then use the web search tool to check AFTER providing the answer, if it feels it’s necessary. E.g. user asks “when was Caesar stabbed” -> llm gives answer -> if needed use web to double check\"\n do not use this tool many times in a single response, you think the user may need more information ask them before calling web search again. You should always sharethe results of your search with the user even if you are not sure if they are useful",
+ "properties": {
+ "query": {
+ "additionalProperties": false,
+ "description": "The search string to search for. Should be long / descriptive",
+ "type": "string"
+ }
+ },
+ "required": [
+ "query"
+ ],
+ "title": "WebSearch",
+ "type": "object"
+ },
+ "outputSchema": {
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "results": {
+ "items": {
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "url",
+ "name"
+ ],
+ "type": "object"
+ },
+ "type": "array"
+ }
+ },
+ "required": [
+ "content",
+ "results"
+ ],
+ "title": "SearchResults",
+ "type": "object"
+ }
+ },
{
"name": "ListDocuments",
"inputSchema": {
@@ -160,1575 +210,1595 @@
}
},
{
- "name": "WebSearch",
+ "name": "ListEmails",
"inputSchema": {
"additionalProperties": false,
- "description": "Trigger an intelligent internet search tool with a search query. Phrase the query as a natural language question. The search tool only has the information passed into the query string to include any relevant context from the conversation. Use this tool when the user specifically requests a web search, asks for resources, asks for links, asks you to read documentationWhen referencing links returned by search remember to use github markdown notation to format them like this [description](https://example.com)Our CEO describes when to use web search like this: I think some important criteria for choosing to search the web are\",\n if the user is asking for time-sensitive information (sports scores, news, current happenings, etc) that would have changed since the knowledge cutoff date\n Specific questions that reference external sources, eg contain a hyperlink in the user message or explicitly say “use webmd” or “check arxiv”\n do not use web search for things that are likely to find SEO slop content; this will make it worse than if it didn’t do it\n the LLM is be allowed to guess an answer and then use the web search tool to check AFTER providing the answer, if it feels it’s necessary. E.g. user asks “when was Caesar stabbed” -> llm gives answer -> if needed use web to double check\"\n do not use this tool many times in a single response, you think the user may need more information ask them before calling web search again. You should always sharethe results of your search with the user even if you are not sure if they are useful",
+ "description": "List the emails the user has access to. Use this tool to discover and browse emails 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": {
- "query": {
+ "cursor": {
"additionalProperties": false,
- "description": "The search string to search for. Should be long / descriptive",
+ "default": null,
+ "description": "A preview response will tell you what the next cursor id is.\n If expected emails are not in the current response and it gives you a cursor id, use this field to list the next page of emails. If no cursor id is provided you've reached the end",
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "limit": {
+ "additionalProperties": false,
+ "default": 20,
+ "description": "limit the max emails returned. This defaults to 20 and has a maximum of 500",
+ "format": "int64",
+ "type": "integer"
+ },
+ "sortMethod": {
+ "additionalProperties": false,
+ "default": "viewed_at",
+ "description": "Sort response by one of: viewed_at | updated_at | created_at | viewed_updated. Prefer viewed_at unless the otherwise specified",
+ "enum": [
+ "viewed_at",
+ "updated_at",
+ "created_at",
+ "viewed_updated"
+ ],
"type": "string"
+ },
+ "view": {
+ "additionalProperties": false,
+ "default": {
+ "standardLabel": null,
+ "userLabel": null
+ },
+ "description": "Choose the view to list emails from. One of either standard label or user label must be specified, otherwise defaults to important.",
+ "properties": {
+ "standardLabel": {
+ "additionalProperties": false,
+ "description": "Prefer important or all. Leave empty if using a user label",
+ "enum": [
+ "Inbox",
+ "Sent",
+ "Drafts",
+ "Starred",
+ "All",
+ "Important",
+ "Other",
+ null
+ ],
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "userLabel": {
+ "additionalProperties": false,
+ "description": "Choose a custom user label to filter by (optional). Standard label will take precedence over user label if both are specified.",
+ "type": [
+ "string",
+ "null"
+ ]
+ }
+ },
+ "required": [
+ "standardLabel",
+ "userLabel"
+ ],
+ "type": "object"
}
},
"required": [
- "query"
+ "cursor",
+ "limit",
+ "sortMethod",
+ "view"
],
- "title": "WebSearch",
+ "title": "ListEmails",
"type": "object"
},
"outputSchema": {
"properties": {
- "content": {
- "type": "string"
- },
- "results": {
+ "items": {
"items": {
"properties": {
- "name": {
- "type": "string"
- },
- "url": {
- "type": "string"
- }
- },
- "required": [
- "url",
- "name"
- ],
- "type": "object"
- },
- "type": "array"
- }
- },
- "required": [
- "content",
- "results"
- ],
- "title": "SearchResults",
- "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.",
+ "attachments": {
+ "items": {
"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"
+ "contentId": {
+ "type": [
+ "string",
+ "null"
+ ]
},
- "org_id": {
- "additionalProperties": false,
- "description": "Channel organization ID to search within. Empty to ignore organization filtering.",
+ "createdAt": {
"format": "int64",
+ "type": "integer"
+ },
+ "filename": {
"type": [
- "integer",
+ "string",
"null"
]
},
- "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"
+ "id": {
+ "format": "uuid",
+ "type": "string"
},
- "thread_ids": {
- "additionalProperties": false,
- "description": "Channel thread IDs to search within. Examples: ['thread123']. Empty to search all threads.",
- "items": {
- "additionalProperties": false,
- "type": "string"
- },
- "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"
- },
- "type": "array"
+ "messageId": {
+ "format": "uuid",
+ "type": "string"
},
- "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"
- },
- "type": "array"
+ "mimeType": {
+ "type": [
+ "string",
+ "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"
- },
- "type": "array"
+ "providerAttachmentId": {
+ "type": [
+ "string",
+ "null"
+ ]
},
- "role": {
- "additionalProperties": false,
- "description": "Chat message roles to search. Examples: ['user'], ['assistant']. Empty to search all roles.",
- "items": {
- "additionalProperties": false,
- "type": "string"
- },
- "type": "array"
+ "sizeBytes": {
+ "format": "int64",
+ "type": [
+ "integer",
+ "null"
+ ]
}
},
"required": [
- "chat_ids",
- "owners",
- "project_ids",
- "role"
+ "id",
+ "messageId",
+ "createdAt"
],
- "type": [
- "object",
- "null"
- ]
+ "type": "object"
},
- "document": {
- "additionalProperties": false,
- "description": "Document filters. `null` to not filter documents searched over.",
+ "type": "array"
+ },
+ "contacts": {
+ "items": {
"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"
+ "emailAddress": {
+ "type": [
+ "string",
+ "null"
+ ]
},
- "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"
+ "id": {
+ "format": "uuid",
+ "type": "string"
},
- "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"
+ "linkId": {
+ "format": "uuid",
+ "type": "string"
},
- "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"
+ "name": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "sfsPhotoUrl": {
+ "type": [
+ "string",
+ "null"
+ ]
}
},
"required": [
- "document_ids",
- "file_types",
- "owners",
- "project_ids"
+ "id",
+ "linkId"
],
- "type": [
- "object",
- "null"
- ]
+ "type": "object"
},
- "email": {
- "additionalProperties": false,
- "description": "Email filters. `null` to not filter emails searched over.",
+ "type": "array"
+ },
+ "createdAt": {
+ "format": "int64",
+ "type": "integer"
+ },
+ "frecencyScore": {
+ "format": "double",
+ "type": [
+ "number",
+ "null"
+ ]
+ },
+ "id": {
+ "format": "uuid",
+ "type": "string"
+ },
+ "inboxVisible": {
+ "type": "boolean"
+ },
+ "isDraft": {
+ "type": "boolean"
+ },
+ "isImportant": {
+ "type": "boolean"
+ },
+ "isRead": {
+ "type": "boolean"
+ },
+ "labels": {
+ "items": {
"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"
- },
- "type": "array"
+ "createdAt": {
+ "format": "date-time",
+ "type": "string"
},
- "cc": {
- "additionalProperties": false,
- "description": "Email CC addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by CC.",
- "items": {
- "additionalProperties": false,
- "type": "string"
- },
- "type": "array"
+ "id": {
+ "format": "uuid",
+ "type": "string"
},
- "recipients": {
- "additionalProperties": false,
- "description": "Email Recipient addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by Recipient.",
- "items": {
- "additionalProperties": false,
- "type": "string"
- },
- "type": "array"
+ "labelListVisibility": {
+ "enum": [
+ "LabelShow",
+ "LabelShowIfUnread",
+ "LabelHide"
+ ],
+ "type": "string"
},
- "senders": {
- "additionalProperties": false,
- "description": "Email sender addresses to filter by. Examples: ['[email protected]']. Empty to search all senders.",
- "items": {
- "additionalProperties": false,
- "type": "string"
- },
- "type": "array"
+ "linkId": {
+ "format": "uuid",
+ "type": "string"
+ },
+ "messageListVisibility": {
+ "enum": [
+ "Show",
+ "Hide"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "providerLabelId": {
+ "type": "string"
+ },
+ "type": {
+ "enum": [
+ "System",
+ "User"
+ ],
+ "type": "string"
}
},
"required": [
- "bcc",
- "cc",
- "recipients",
- "senders"
+ "id",
+ "linkId",
+ "providerLabelId",
+ "name",
+ "createdAt",
+ "messageListVisibility",
+ "labelListVisibility",
+ "type"
],
- "type": [
- "object",
- "null"
- ]
+ "type": "object"
},
- "project": {
- "additionalProperties": false,
- "description": "Project filters. `null` to not filter projects searched over.",
+ "type": "array"
+ },
+ "macroAttachments": {
+ "items": {
"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"
+ "dbId": {
+ "format": "uuid",
+ "type": "string"
},
- "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"
+ "itemId": {
+ "format": "uuid",
+ "type": "string"
+ },
+ "itemType": {
+ "type": "string"
+ },
+ "messageId": {
+ "format": "uuid",
+ "type": "string"
}
},
"required": [
- "owners",
- "project_ids"
+ "dbId",
+ "messageId",
+ "itemId",
+ "itemType"
],
- "type": [
- "object",
- "null"
- ]
- }
+ "type": "object"
+ },
+ "type": "array"
},
- "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"
- ],
- "type": "string"
+ "name": {
+ "type": [
+ "string",
+ "null"
+ ]
},
- "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,
+ "ownerId": {
"type": "string"
},
- "type": [
- "array",
- "null"
- ]
- }
+ "providerId": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "senderEmail": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "senderName": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "senderPhotoUrl": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "snippet": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "sortTs": {
+ "format": "int64",
+ "type": "integer"
+ },
+ "updatedAt": {
+ "format": "int64",
+ "type": "integer"
+ },
+ "viewedAt": {
+ "format": "int64",
+ "type": [
+ "integer",
+ "null"
+ ]
+ }
+ },
+ "required": [
+ "id",
+ "ownerId",
+ "inboxVisible",
+ "isRead",
+ "isDraft",
+ "isImportant",
+ "sortTs",
+ "createdAt",
+ "updatedAt",
+ "attachments",
+ "macroAttachments",
+ "contacts",
+ "labels"
+ ],
+ "type": "object"
},
- "required": [
- "filters",
- "include",
- "match_type",
- "search_on",
- "terms"
+ "type": "array"
+ },
+ "next_cursor": {
+ "type": [
+ "string",
+ "null"
+ ]
+ }
+ },
+ "required": [
+ "items"
+ ],
+ "title": "ApiPaginatedThreadCursor",
+ "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"
],
- "type": "object"
+ "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": [
- "exhaustiveSearch",
- "pageOffset",
- "pageSize",
- "request"
+ "contentType",
+ "ids",
+ "messagesSince"
],
- "title": "UnifiedSearch",
+ "title": "Read",
"type": "object"
},
"outputSchema": {
"properties": {
- "response": {
- "description": "The search results",
- "properties": {
- "results": {
- "description": "The search results (truncated to `results_returned` limit if applicable)",
- "items": {
- "oneOf": [
- {
+ "content": {
+ "oneOf": [
+ {
+ "properties": {
+ "documents": {
+ "items": {
"properties": {
- "document_id": {
- "description": "The document id",
- "type": "string"
- },
- "document_name": {
- "description": "The document name",
+ "content": {
"type": "string"
},
- "file_type": {
- "description": "The file type",
+ "documentId": {
"type": "string"
},
- "highlight": {
- "description": "The highlights on the document",
+ "metadata": {
"properties": {
- "content": {
- "description": "The highlight match on the content field",
- "items": {
- "type": "string"
- },
- "type": "array"
+ "deleted": {
+ "type": "boolean"
},
- "name": {
- "description": "The highlight match on the name field",
+ "documentName": {
+ "type": "string"
+ },
+ "fileType": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "owner": {
+ "type": "string"
+ },
+ "projectId": {
"type": [
"string",
"null"
]
}
},
+ "required": [
+ "documentName",
+ "owner",
+ "deleted"
+ ],
"type": "object"
- },
- "node_id": {
- "description": "The node id",
- "type": "string"
- },
- "owner_id": {
- "description": "The owner id",
- "type": "string"
- },
- "raw_content": {
- "description": "The raw content of the document",
- "type": [
- "string",
- "null"
- ]
- },
- "type": {
- "const": "document",
- "type": "string"
- },
- "updated_at": {
- "description": "The time the document was last updated",
- "format": "date-time",
- "type": "string"
}
},
"required": [
- "type",
- "document_id",
- "document_name",
- "node_id",
- "owner_id",
- "file_type",
- "updated_at",
- "highlight"
+ "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"
+ },
+ "type": {
+ "const": "channel",
+ "type": "string"
+ }
+ },
+ "required": [
+ "type",
+ "channel_id",
+ "transcript"
+ ],
+ "type": "object"
+ },
+ {
+ "properties": {
+ "conversation": {
+ "items": {
"properties": {
"chat_id": {
- "description": "The chat id",
- "type": "string"
- },
- "chat_message_id": {
- "description": "The chat message id",
"type": "string"
},
- "highlight": {
- "description": "The highlights on the chat",
- "properties": {
- "content": {
- "description": "The highlight match on the content field",
- "items": {
+ "messages": {
+ "items": {
+ "properties": {
+ "attachment_summaries": {
+ "items": {
+ "oneOf": [
+ {
+ "additionalProperties": false,
+ "properties": {
+ "Summary": {
+ "properties": {
+ "created_at": {
+ "format": "date-time",
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "document_id": {
+ "type": "string"
+ },
+ "id": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "summary": {
+ "type": "string"
+ },
+ "version_id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "document_id",
+ "summary",
+ "version_id"
+ ],
+ "type": "object"
+ }
+ },
+ "required": [
+ "Summary"
+ ],
+ "type": "object"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "NoSummary": {
+ "properties": {
+ "document_id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "document_id"
+ ],
+ "type": "object"
+ }
+ },
+ "required": [
+ "NoSummary"
+ ],
+ "type": "object"
+ }
+ ]
+ },
+ "type": "array"
+ },
+ "content": {
"type": "string"
},
- "type": "array"
+ "date": {
+ "format": "date-time",
+ "type": "string"
+ }
},
- "name": {
- "description": "The highlight match on the name field",
- "type": [
- "string",
- "null"
- ]
- }
+ "required": [
+ "content",
+ "date",
+ "attachment_summaries"
+ ],
+ "type": "object"
},
- "type": "object"
- },
- "role": {
- "description": "The role",
- "type": "string"
+ "type": "array"
},
"title": {
- "description": "The title",
- "type": "string"
- },
- "type": {
- "const": "chat",
- "type": "string"
- },
- "updated_at": {
- "description": "The time the chat was last updated",
- "format": "date-time",
- "type": "string"
- },
- "user_id": {
- "description": "The user id",
"type": "string"
}
},
"required": [
- "type",
"chat_id",
- "chat_message_id",
- "user_id",
- "role",
- "updated_at",
"title",
- "highlight"
+ "messages"
],
"type": "object"
},
- {
+ "type": "array"
+ },
+ "type": {
+ "const": "chat",
+ "type": "string"
+ }
+ },
+ "required": [
+ "type",
+ "conversation"
+ ],
+ "type": "object"
+ },
+ {
+ "properties": {
+ "messages": {
+ "items": {
"properties": {
"bcc": {
- "description": "The bcc",
"items": {
"type": "string"
},
"type": "array"
},
"cc": {
- "description": "The cc",
"items": {
"type": "string"
},
"type": "array"
},
- "highlight": {
- "description": "The highlights on the email",
- "properties": {
- "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"
- ]
- }
- },
- "type": "object"
+ "content": {
+ "type": "string"
},
- "labels": {
- "description": "The labels",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "link_id": {
- "description": "The link id",
- "type": "string"
- },
- "message_id": {
- "description": "The message id",
- "type": "string"
- },
- "recipients": {
- "description": "The recipients",
+ "messageId": {
+ "type": "string"
+ },
+ "recipients": {
"items": {
"type": "string"
},
"type": "array"
},
"sender": {
- "description": "The sender",
"type": "string"
},
- "sent_at": {
- "description": "The time the email was sent",
+ "sentAt": {
"format": "date-time",
"type": [
"string",
"null"
]
- },
- "subject": {
- "description": "The subject",
- "type": [
- "string",
- "null"
- ]
- },
- "thread_id": {
- "description": "The thread id",
- "type": "string"
- },
- "type": {
- "const": "email",
- "type": "string"
- },
- "updated_at": {
- "description": "The time the email was last updated",
- "format": "date-time",
- "type": "string"
- },
- "user_id": {
- "description": "The user id",
- "type": "string"
}
},
"required": [
- "type",
- "thread_id",
- "message_id",
+ "messageId",
"sender",
"recipients",
"cc",
"bcc",
- "labels",
- "link_id",
- "user_id",
- "updated_at",
- "highlight"
- ],
- "type": "object"
- },
- {
- "properties": {
- "channel_id": {
- "description": "The channel id",
- "type": "string"
- },
- "channel_type": {
- "description": "The channel type",
- "type": "string"
- },
- "created_at": {
- "description": "The time the channel message was created",
- "format": "date-time",
- "type": "string"
- },
- "highlight": {
- "description": "The highlights on the channel message",
- "properties": {
- "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"
- ]
- }
- },
- "type": "object"
- },
- "mentions": {
- "description": "The mentions",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "message_id": {
- "description": "The message id",
- "type": "string"
- },
- "org_id": {
- "description": "The org id",
- "format": "int64",
- "type": [
- "integer",
- "null"
- ]
- },
- "sender_id": {
- "description": "The sender id",
- "type": "string"
- },
- "thread_id": {
- "description": "The thread id",
- "type": [
- "string",
- "null"
- ]
- },
- "type": {
- "const": "channel",
- "type": "string"
- },
- "updated_at": {
- "description": "The time the channel message was last updated",
- "format": "date-time",
- "type": "string"
- }
- },
- "required": [
- "type",
- "channel_id",
- "channel_type",
- "message_id",
- "sender_id",
- "mentions",
- "created_at",
- "updated_at",
- "highlight"
+ "content"
],
"type": "object"
},
- {
- "properties": {
- "created_at": {
- "description": "The time the project was created",
- "format": "date-time",
- "type": "string"
- },
- "highlight": {
- "description": "The highlights on the project",
- "properties": {
- "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"
- ]
- }
- },
- "type": "object"
- },
- "project_id": {
- "description": "The project id",
- "type": "string"
- },
- "project_name": {
- "description": "The project name",
- "type": "string"
- },
- "type": {
- "const": "project",
- "type": "string"
- },
- "updated_at": {
- "description": "The time the project was last updated",
- "format": "date-time",
- "type": "string"
- },
- "user_id": {
- "description": "The id of the user who created the project",
- "type": "string"
- }
- },
- "required": [
- "type",
- "project_id",
- "updated_at",
- "created_at",
- "project_name",
- "user_id",
- "highlight"
- ],
- "type": "object"
- }
- ]
+ "type": "array"
+ },
+ "subject": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "thread_id": {
+ "type": "string"
+ },
+ "type": {
+ "const": "email",
+ "type": "string"
+ }
},
- "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": [
+ "type",
+ "thread_id",
+ "messages"
+ ],
+ "type": "object"
}
- },
- "required": [
- "results",
- "totalResults",
- "resultsReturned"
- ],
- "type": "object"
- },
- "responseSchema": {
- "description": "The JSON schema for the response so the LLM can understand it"
+ ]
}
},
"required": [
- "response",
- "responseSchema"
+ "content"
],
- "title": "UnifiedSearchResponseOutput",
+ "title": "ReadResponse",
"type": "object"
}
},
{
- "name": "ListEmails",
+ "name": "MarkdownRewrite",
"inputSchema": {
"additionalProperties": false,
- "description": "List the emails the user has access to. Use this tool to discover and browse emails 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": "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": {
- "cursor": {
- "additionalProperties": false,
- "default": null,
- "description": "A preview response will tell you what the next cursor id is.\n If expected emails are not in the current response and it gives you a cursor id, use this field to list the next page of emails. If no cursor id is provided you've reached the end",
- "type": [
- "string",
- "null"
- ]
- },
- "limit": {
- "additionalProperties": false,
- "default": 20,
- "description": "limit the max emails returned. This defaults to 20 and has a maximum of 500",
- "format": "int64",
- "type": "integer"
- },
- "sortMethod": {
+ "instructions": {
"additionalProperties": false,
- "default": "viewed_at",
- "description": "Sort response by one of: viewed_at | updated_at | created_at | viewed_updated. Prefer viewed_at unless the otherwise specified",
- "enum": [
- "viewed_at",
- "updated_at",
- "created_at",
- "viewed_updated"
- ],
+ "description": "Instructions for the revision agent to follow to edit the markdown. These instructions will be provided by the user.",
"type": "string"
},
- "view": {
+ "markdown_file_id": {
"additionalProperties": false,
- "default": {
- "standardLabel": null,
- "userLabel": null
- },
- "description": "Choose the view to list emails from. One of either standard label or user label must be specified, otherwise defaults to important.",
- "properties": {
- "standardLabel": {
- "additionalProperties": false,
- "description": "Prefer important or all. Leave empty if using a user label",
- "enum": [
- "Inbox",
- "Sent",
- "Drafts",
- "Starred",
- "All",
- "Important",
- "Other",
- null
- ],
- "type": [
- "string",
- "null"
- ]
- },
- "userLabel": {
- "additionalProperties": false,
- "description": "Choose a custom user label to filter by (optional). Standard label will take precedence over user label if both are specified.",
- "type": [
- "string",
- "null"
- ]
- }
- },
- "required": [
- "standardLabel",
- "userLabel"
- ],
- "type": "object"
+ "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": [
- "cursor",
- "limit",
- "sortMethod",
- "view"
+ "instructions",
+ "markdown_file_id"
],
- "title": "ListEmails",
+ "title": "MarkdownRewrite",
"type": "object"
},
"outputSchema": {
+ "additionalProperties": false,
"properties": {
- "items": {
+ "diffs": {
"items": {
+ "additionalProperties": false,
"properties": {
- "attachments": {
- "items": {
+ "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": {
- "contentId": {
- "type": [
- "string",
- "null"
- ]
- },
- "createdAt": {
- "format": "int64",
- "type": "integer"
- },
- "filename": {
- "type": [
- "string",
- "null"
- ]
- },
- "id": {
- "format": "uuid",
- "type": "string"
- },
- "messageId": {
- "format": "uuid",
- "type": "string"
- },
- "mimeType": {
- "type": [
- "string",
- "null"
- ]
+ "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"
},
- "providerAttachmentId": {
- "type": [
- "string",
- "null"
- ]
+ "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"
},
- "sizeBytes": {
+ "org_id": {
+ "additionalProperties": false,
+ "description": "Channel organization ID to search within. Empty to ignore organization filtering.",
"format": "int64",
"type": [
"integer",
"null"
]
+ },
+ "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"
+ },
+ "thread_ids": {
+ "additionalProperties": false,
+ "description": "Channel thread IDs to search within. Examples: ['thread123']. Empty to search all threads.",
+ "items": {
+ "additionalProperties": false,
+ "type": "string"
+ },
+ "type": "array"
}
},
"required": [
- "id",
- "messageId",
- "createdAt"
+ "channel_ids",
+ "mentions",
+ "org_id",
+ "sender_ids",
+ "thread_ids"
],
- "type": "object"
+ "type": [
+ "object",
+ "null"
+ ]
},
- "type": "array"
- },
- "contacts": {
- "items": {
+ "chat": {
+ "additionalProperties": false,
+ "description": "Chat filters. `null` to not filter chats searched over.",
"properties": {
- "emailAddress": {
- "type": [
- "string",
- "null"
- ]
- },
- "id": {
- "format": "uuid",
- "type": "string"
+ "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"
+ },
+ "type": "array"
},
- "linkId": {
- "format": "uuid",
- "type": "string"
+ "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"
+ },
+ "type": "array"
},
- "name": {
- "type": [
- "string",
- "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"
+ },
+ "type": "array"
},
- "sfsPhotoUrl": {
- "type": [
- "string",
- "null"
- ]
+ "role": {
+ "additionalProperties": false,
+ "description": "Chat message roles to search. Examples: ['user'], ['assistant']. Empty to search all roles.",
+ "items": {
+ "additionalProperties": false,
+ "type": "string"
+ },
+ "type": "array"
}
},
"required": [
- "id",
- "linkId"
+ "chat_ids",
+ "owners",
+ "project_ids",
+ "role"
],
- "type": "object"
+ "type": [
+ "object",
+ "null"
+ ]
},
- "type": "array"
- },
- "createdAt": {
- "format": "int64",
- "type": "integer"
- },
- "frecencyScore": {
- "format": "double",
- "type": [
- "number",
- "null"
- ]
- },
- "id": {
- "format": "uuid",
- "type": "string"
- },
- "inboxVisible": {
- "type": "boolean"
- },
- "isDraft": {
- "type": "boolean"
- },
- "isImportant": {
- "type": "boolean"
- },
- "isRead": {
- "type": "boolean"
- },
- "macroAttachments": {
- "items": {
+ "document": {
+ "additionalProperties": false,
+ "description": "Document filters. `null` to not filter documents searched over.",
"properties": {
- "dbId": {
- "format": "uuid",
- "type": "string"
+ "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"
},
- "itemId": {
- "format": "uuid",
- "type": "string"
+ "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"
},
- "itemType": {
- "type": "string"
+ "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"
},
- "messageId": {
- "format": "uuid",
- "type": "string"
+ "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"
}
},
"required": [
- "dbId",
- "messageId",
- "itemId",
- "itemType"
+ "document_ids",
+ "file_types",
+ "owners",
+ "project_ids"
],
- "type": "object"
+ "type": [
+ "object",
+ "null"
+ ]
},
- "type": "array"
- },
- "name": {
- "type": [
- "string",
- "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"
+ },
+ "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"
+ },
+ "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"
+ },
+ "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"
+ },
+ "type": "array"
+ }
+ },
+ "required": [
+ "bcc",
+ "cc",
+ "recipients",
+ "senders"
+ ],
+ "type": [
+ "object",
+ "null"
+ ]
+ },
+ "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"
+ },
+ "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"
+ }
+ },
+ "required": [
+ "owners",
+ "project_ids"
+ ],
+ "type": [
+ "object",
+ "null"
+ ]
+ }
},
- "ownerId": {
+ "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"
+ ],
"type": "string"
},
- "providerId": {
- "type": [
- "string",
- "null"
- ]
- },
- "senderEmail": {
- "type": [
- "string",
- "null"
- ]
- },
- "senderName": {
- "type": [
- "string",
- "null"
- ]
- },
- "senderPhotoUrl": {
- "type": [
- "string",
- "null"
- ]
- },
- "snippet": {
- "type": [
- "string",
- "null"
- ]
- },
- "sortTs": {
- "format": "int64",
- "type": "integer"
- },
- "updatedAt": {
- "format": "int64",
- "type": "integer"
- },
- "viewedAt": {
- "format": "int64",
- "type": [
- "integer",
- "null"
- ]
- }
+ "type": "array"
},
- "required": [
- "id",
- "ownerId",
- "inboxVisible",
- "isRead",
- "isDraft",
- "isImportant",
- "sortTs",
- "createdAt",
- "updatedAt",
- "attachments",
- "macroAttachments",
- "contacts"
- ],
- "type": "object"
+ "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": [
+ "array",
+ "null"
+ ]
+ }
},
- "type": "array"
- },
- "next_cursor": {
- "type": [
- "string",
- "null"
- ]
- }
- },
- "required": [
- "items"
- ],
- "title": "ApiPaginatedThreadCursor",
- "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"
+ "required": [
+ "filters",
+ "include",
+ "match_type",
+ "search_on",
+ "terms"
],
- "type": "string"
- },
- "ids": {
- "additionalProperties": false,
- "description": "ID(s) of the content to read. IMPORTANT: Currently only chat-message content type supports MULTIPLE ids! For all other content types 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"
- ]
+ "type": "object"
}
},
"required": [
- "contentType",
- "ids",
- "messagesSince"
+ "exhaustiveSearch",
+ "pageOffset",
+ "pageSize",
+ "request"
],
- "title": "Read",
+ "title": "UnifiedSearch",
"type": "object"
},
"outputSchema": {
"properties": {
- "content": {
- "oneOf": [
- {
- "properties": {
- "content": {
- "type": "string"
- },
- "document_id": {
- "type": "string"
- },
- "metadata": {
- "properties": {
- "deleted": {
- "type": "boolean"
- },
- "documentName": {
- "type": "string"
- },
- "fileType": {
- "type": [
- "string",
- "null"
- ]
- },
- "owner": {
- "type": "string"
- },
- "projectId": {
- "type": [
- "string",
- "null"
- ]
- }
- },
- "required": [
- "documentName",
- "owner",
- "deleted"
- ],
- "type": "object"
- },
- "type": {
- "const": "document",
- "type": "string"
- }
- },
- "required": [
- "type",
- "document_id",
- "content",
- "metadata"
- ],
- "type": "object"
- },
- {
- "properties": {
- "channel_id": {
- "type": "string"
- },
- "channel_name": {
- "type": [
- "string",
- "null"
- ]
- },
- "transcript": {
- "type": "string"
- },
- "type": {
- "const": "channel",
- "type": "string"
- }
- },
- "required": [
- "type",
- "channel_id",
- "transcript"
- ],
- "type": "object"
- },
- {
- "properties": {
- "conversation": {
- "items": {
+ "response": {
+ "description": "The search results",
+ "properties": {
+ "results": {
+ "description": "The search results (truncated to `results_returned` limit if applicable)",
+ "items": {
+ "oneOf": [
+ {
"properties": {
- "chat_id": {
+ "document_id": {
+ "description": "The document id",
"type": "string"
},
- "messages": {
- "items": {
- "properties": {
- "attachment_summaries": {
- "items": {
- "oneOf": [
- {
- "additionalProperties": false,
- "properties": {
- "Summary": {
- "properties": {
- "created_at": {
- "format": "date-time",
- "type": [
- "string",
- "null"
- ]
- },
- "document_id": {
- "type": "string"
- },
- "id": {
- "type": [
- "string",
- "null"
- ]
- },
- "summary": {
- "type": "string"
- },
- "version_id": {
- "type": "string"
- }
- },
- "required": [
- "document_id",
- "summary",
- "version_id"
- ],
- "type": "object"
- }
- },
- "required": [
- "Summary"
- ],
- "type": "object"
- },
- {
- "additionalProperties": false,
- "properties": {
- "NoSummary": {
- "properties": {
- "document_id": {
- "type": "string"
- }
- },
- "required": [
- "document_id"
- ],
- "type": "object"
- }
- },
- "required": [
- "NoSummary"
- ],
- "type": "object"
- }
- ]
- },
- "type": "array"
+ "document_name": {
+ "description": "The document name",
+ "type": "string"
+ },
+ "file_type": {
+ "description": "The file type",
+ "type": "string"
+ },
+ "highlight": {
+ "description": "The highlights on the document",
+ "properties": {
+ "content": {
+ "description": "The highlight match on the content field",
+ "items": {
+ "type": "string"
},
- "content": {
+ "type": "array"
+ },
+ "name": {
+ "description": "The highlight match on the name field",
+ "type": [
+ "string",
+ "null"
+ ]
+ }
+ },
+ "type": "object"
+ },
+ "node_id": {
+ "description": "The node id",
+ "type": "string"
+ },
+ "owner_id": {
+ "description": "The owner id",
+ "type": "string"
+ },
+ "raw_content": {
+ "description": "The raw content of the document",
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "type": {
+ "const": "document",
+ "type": "string"
+ },
+ "updated_at": {
+ "description": "The time the document was last updated",
+ "format": "date-time",
+ "type": "string"
+ }
+ },
+ "required": [
+ "type",
+ "document_id",
+ "document_name",
+ "node_id",
+ "owner_id",
+ "file_type",
+ "updated_at",
+ "highlight"
+ ],
+ "type": "object"
+ },
+ {
+ "properties": {
+ "chat_id": {
+ "description": "The chat id",
+ "type": "string"
+ },
+ "chat_message_id": {
+ "description": "The chat message id",
+ "type": "string"
+ },
+ "highlight": {
+ "description": "The highlights on the chat",
+ "properties": {
+ "content": {
+ "description": "The highlight match on the content field",
+ "items": {
"type": "string"
},
- "date": {
- "format": "date-time",
+ "type": "array"
+ },
+ "name": {
+ "description": "The highlight match on the name field",
+ "type": [
+ "string",
+ "null"
+ ]
+ }
+ },
+ "type": "object"
+ },
+ "role": {
+ "description": "The role",
+ "type": "string"
+ },
+ "title": {
+ "description": "The title",
+ "type": "string"
+ },
+ "type": {
+ "const": "chat",
+ "type": "string"
+ },
+ "updated_at": {
+ "description": "The time the chat was last updated",
+ "format": "date-time",
+ "type": "string"
+ },
+ "user_id": {
+ "description": "The user id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "type",
+ "chat_id",
+ "chat_message_id",
+ "user_id",
+ "role",
+ "updated_at",
+ "title",
+ "highlight"
+ ],
+ "type": "object"
+ },
+ {
+ "properties": {
+ "bcc": {
+ "description": "The bcc",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "cc": {
+ "description": "The cc",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "highlight": {
+ "description": "The highlights on the email",
+ "properties": {
+ "content": {
+ "description": "The highlight match on the content field",
+ "items": {
"type": "string"
- }
+ },
+ "type": "array"
},
- "required": [
- "content",
- "date",
- "attachment_summaries"
- ],
- "type": "object"
+ "name": {
+ "description": "The highlight match on the name field",
+ "type": [
+ "string",
+ "null"
+ ]
+ }
+ },
+ "type": "object"
+ },
+ "labels": {
+ "description": "The labels",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "link_id": {
+ "description": "The link id",
+ "type": "string"
+ },
+ "message_id": {
+ "description": "The message id",
+ "type": "string"
+ },
+ "recipients": {
+ "description": "The recipients",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "sender": {
+ "description": "The sender",
+ "type": "string"
+ },
+ "sent_at": {
+ "description": "The time the email was sent",
+ "format": "date-time",
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "subject": {
+ "description": "The subject",
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "thread_id": {
+ "description": "The thread id",
+ "type": "string"
+ },
+ "type": {
+ "const": "email",
+ "type": "string"
+ },
+ "updated_at": {
+ "description": "The time the email was last updated",
+ "format": "date-time",
+ "type": "string"
+ },
+ "user_id": {
+ "description": "The user id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "type",
+ "thread_id",
+ "message_id",
+ "sender",
+ "recipients",
+ "cc",
+ "bcc",
+ "labels",
+ "link_id",
+ "user_id",
+ "updated_at",
+ "highlight"
+ ],
+ "type": "object"
+ },
+ {
+ "properties": {
+ "channel_id": {
+ "description": "The channel id",
+ "type": "string"
+ },
+ "channel_type": {
+ "description": "The channel type",
+ "type": "string"
+ },
+ "created_at": {
+ "description": "The time the channel message was created",
+ "format": "date-time",
+ "type": "string"
+ },
+ "highlight": {
+ "description": "The highlights on the channel message",
+ "properties": {
+ "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"
+ ]
+ }
+ },
+ "type": "object"
+ },
+ "mentions": {
+ "description": "The mentions",
+ "items": {
+ "type": "string"
},
"type": "array"
},
- "title": {
+ "message_id": {
+ "description": "The message id",
+ "type": "string"
+ },
+ "org_id": {
+ "description": "The org id",
+ "format": "int64",
+ "type": [
+ "integer",
+ "null"
+ ]
+ },
+ "sender_id": {
+ "description": "The sender id",
+ "type": "string"
+ },
+ "thread_id": {
+ "description": "The thread id",
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "type": {
+ "const": "channel",
+ "type": "string"
+ },
+ "updated_at": {
+ "description": "The time the channel message was last updated",
+ "format": "date-time",
"type": "string"
}
},
"required": [
- "chat_id",
- "title",
- "messages"
+ "type",
+ "channel_id",
+ "channel_type",
+ "message_id",
+ "sender_id",
+ "mentions",
+ "created_at",
+ "updated_at",
+ "highlight"
],
"type": "object"
},
- "type": "array"
- },
- "type": {
- "const": "chat",
- "type": "string"
- }
- },
- "required": [
- "type",
- "conversation"
- ],
- "type": "object"
- },
- {
- "properties": {
- "messages": {
- "items": {
+ {
"properties": {
- "bcc": {
- "items": {
- "type": "string"
- },
- "type": "array"
+ "created_at": {
+ "description": "The time the project was created",
+ "format": "date-time",
+ "type": "string"
},
- "cc": {
- "items": {
- "type": "string"
+ "highlight": {
+ "description": "The highlights on the project",
+ "properties": {
+ "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"
+ ]
+ }
},
- "type": "array"
+ "type": "object"
},
- "content": {
+ "project_id": {
+ "description": "The project id",
"type": "string"
},
- "messageId": {
+ "project_name": {
+ "description": "The project name",
"type": "string"
},
- "recipients": {
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "sender": {
+ "type": {
+ "const": "project",
"type": "string"
},
- "sentAt": {
+ "updated_at": {
+ "description": "The time the project was last updated",
"format": "date-time",
- "type": [
- "string",
- "null"
- ]
+ "type": "string"
+ },
+ "user_id": {
+ "description": "The id of the user who created the project",
+ "type": "string"
}
},
"required": [
- "messageId",
- "sender",
- "recipients",
- "cc",
- "bcc",
- "content"
+ "type",
+ "project_id",
+ "updated_at",
+ "created_at",
+ "project_name",
+ "user_id",
+ "highlight"
],
"type": "object"
- },
- "type": "array"
- },
- "subject": {
- "type": [
- "string",
- "null"
- ]
- },
- "thread_id": {
- "type": "string"
- },
- "type": {
- "const": "email",
- "type": "string"
- }
- },
- "required": [
- "type",
- "thread_id",
- "messages"
- ],
- "type": "object"
- }
- ]
- }
- },
- "required": [
- "content"
- ],
- "title": "ReadResponse",
- "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"
- },
- "node_key": {
- "type": "string"
+ }
+ ]
},
- "operation": {
- "type": "string"
- }
+ "type": "array"
},
- "required": [
- "operation",
- "node_key",
- "markdown_text"
- ],
- "type": "object"
+ "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"
+ }
},
- "type": "array"
+ "required": [
+ "results",
+ "totalResults",
+ "resultsReturned"
+ ],
+ "type": "object"
+ },
+ "responseSchema": {
+ "description": "The JSON schema for the response so the LLM can understand it"
}
},
"required": [
- "diffs"
+ "response",
+ "responseSchema"
],
- "title": "AIDiffResponse",
+ "title": "UnifiedSearchResponseOutput",
"type": "object"
}
}