Common tool access
Tools available to all agents.
The Agent SDK provides a set of common tools that all of your agents automatically have access to. These are the tools for working with scheduled tasks, sending emails or slacks, uploading documents and moving conversations between mediums.
In addition, it contains some static methods for converting Markdown to Word and PDF and then uploading those to a configured TemporaryFileStorageService
.
Tools
changeChannelForConversation
Changes the output channel of a conversation or thread. For example, 'move this to slack' or 'move this conversation to email' will send a message to that channel wih the "overview of the conversation so far and let you continue right from there. The user can also optionally indicate another user or email they want it sent to. If no 'to' provided then assume current user's details.
listMyScheduledTasksOrOrgsTasks
Lists the user's active or scheduled workflows (including tasks, jobs, etc). The user can also request to list all the organizations tasks but only if they have the proper permission (meaning they are an admin). You should only use the tool output - do not mention random or hallucinated tasks.
unscheduleOrRemoveOrDeleteTaskOrJob
Unschedule or remove or delete a previously scheduled task or job - including removing or deleting all of the users tasks or the organization's tasks. You must always explicitly confirm that the user wants to unschedule or remove the provided job id or all tasks if requested - never skip this. You should explicitly ONLY clear all the org tasks if the user specifically mentions clearing ALL the organizations tasks and has the proper permission. clearAllOrgTasks cannot be true if clearAllMyTasks is true. The Job id is always required and the user can only delete their own jobs unless they are an admin. The job id should explicitly never be modified from what the user sends to you.
addNewKnowledgeOrUploadOrAttachUrlsOrFiles
This tool is explicitly only for fetching files and urls that contain a proper public URL schemes (http:, https:, ftp:, etc) - do NOT try to upload files without a scheme and do not upload files with a file: scheme. If it does not contain a scheme then do not call this tool. Allows the user to either upload and process or attach or analyze the files (for asking questions or analyzing them) or can share the information in the files with other users. Unless told otherwise, you should explicitly always confirm that the user wants to upload the files. Explicitly do not modify the file paths or urls and keep the filenames in the same order with their urls. If the user is working on a specific task (like analysis or importing users), explicitly do not ask how they want to share the file - assume it is for that task and not shared with others (unless the task is to upload new knowledge or just to upload a file). If asking for help uploading a file, specifically check if they will share with others. Explicitly call this tool if the user provides a set of URLs for files - often prefixed by 'files:' at the start of a newline (not the protocol). If the user is asking to share it with others, you should remind them that the information will be accessible to anyone with access to team. If the user explicitly provides urls or files attachments explicitly or the agent calls this directly then execute this tool.
sendEmail
A generic tool for agents to be able to email. Usually only used if the user asks to send an email, this tool is also the default for sending the results or summary of a particular request. Use it if the user is asking to 'send' something and does not include another tool. A valid email address is required (or the user can say something like 'send this email to me' or 'send this to me'), but if no 'to' is provided, assume it's the current user's details. The recipient may be 'me' or empty if the user just assumes themselves. Do not ask for further clarification if so. You should just leave the email empty or set to 'current' rather than including some example.com email. Explicitly do not call this tool if you just used it for the same 'To'. If the response had no actual content to send, set nothingToSend to true."
sendSlack
A generic tool for agents to be able to send slack messages. A valid slack channel (#channel) that the agents are part of or a valid slack user (@display name) is required. If no 'to' is provided, assume it's the current user's details (explicitly not the agent's details) and set to empty or set to 'current' rather than including some example value. The recipient may be 'me' or empty if the user just assumes themselves. Do not ask for further clarification if so. Do not make up values. If the 'to' is provided and formatted like a Slack link to a channel or to a user, then remove the formatting and keep the slack id (keep the # sign or @ symbol) and strip all other formatting. Strictly do not modify the 'response' sent to you - it needs to remain intact. If the response had no actual content to send, set nothingToSend to true.
Helper Methods
In addition to tools that the LLM can call automatically, CommonAgentTools.java also provides 4 helper methods for working with files.
CommonAgentTools.waitForUpload - useful for checking if a file has finished processing - this is mostly used when the vector store has a slight delay in the embedding.
CommonAgentTools.buildAndUploadWordVersion - takes Markdown from the LLM and converts it to a nicely formatted Word document which is uploaded/saved to temporary storage.
CommonAgentTools.buildAndUploadPDFVersion - takes Markdown from the LLM and converts it to a nicely formatted PDF document which is uploaded/saved to temporary storage.
CommonAgentTools.getSafeFilenameForString - useful to strip bad characters from a string that you want to use as the filename.
Last updated
Was this helpful?