3.2 KiB
AGENTS.md
These instructions cover the tool calling system in app/MindWork AI Studio/Tools/ToolCallingSystem/. They
add to the AGENTS.md in the repository root, which applies here as well; its "Tool Calling System"
section explains how selections name tool collections.
Tool Calling System
When adding, changing, or removing model-driven tools, keep these parts in sync:
app/MindWork AI Studio/Tools/ToolCallingSystem/ToolCallingImplementations/for theIToolImplementationclass, which states its ownToolDefinitionthroughGetDefinition(), written withToolSettingsSchemaBuilderfor its settings andToolParameterSchemaBuilderfor the arguments the model passes. There are no tool definition files; a tool arriving from elsewhere brings anIToolDefinitionSourceinstead.app/MindWork AI Studio/Program.csfor DI registration of the implementation. Registering it as anIToolImplementationis enough, becauseCodeToolDefinitionSourcecollects the definitions of all of them.- An
IToolCollectionnext to the tools, registered inProgram.cs, when tools only make sense together. app/MindWork AI Studio/Tools/ToolCallingSystem/ToolSelectionRules.cswhen the shared tool-call limits change. A tool's own minimum provider confidence belongs in its definition, or in the definition of its collection, not here.app/MindWork AI Studio/Tools/ToolCallingSystem/ToolSettingsOptionSources.cswhen a tool setting offers a fixed choice the app maintains, such as languages. Prefer this over spelling the values out in the settings schema; it keeps the list in one place and gives the user translated names.app/MindWork AI Studio/Plugins/configuration/plugin.luato document each setting's field name, meaning, and data type. Tool settings need no code to be centrally manageable: an organization addresses them by"<toolId>.<fieldName>"inDataTools.LockedToolSettingsorDataTools.DefaultToolSettings.
Tool implementations must treat model-provided arguments as untrusted input. Validate settings and arguments, protect secrets with SensitiveTraceArgumentNames, use ToolExecutionBlockedException for intentional policy blocks, and check provider confidence before returning sensitive data to the model.
A tool which belongs to a preview feature returns false from IToolImplementation.IsAvailable while the preview is switched off; the registry then leaves it out of every list, every request, and the token count, so no component has to check that preview for the tool. Every tool declares in IToolImplementation.OutboundData where its arguments go: a chat which read from a mailbox keeps the tools whose data goes further than the mailbox allows from being offered and from running, see ToolSelectionRules.IsOutboundDataAllowed. A tool which brings content of a mailbox into the chat raises ToolExecutionResult.RequiredOutboundDataRestriction, next to RequiredProviderConfidence and RequiredDataSecurity. "Searching Mailboxes" in documentation/Tools.md explains the mail tools.
A tool which offers itself from the context of a chat instead of being selected, such as semantic_search, sets Activation = ToolActivation.CONTEXT and tailors its function to each request in ResolveFunctionAsync.