Overview
Version: v10.4.0 Intelligence & DX
Effort: L · 5–8 days
Branch: feature/i01-function-calling
Enable council members to call external tools (functions) during their debate turns, using the AIFunction abstraction from Microsoft.Extensions.AI.
Background
Currently council members only reason and respond with text. In many real-world scenarios (code review, requirements analysis, risk assessment) members need to query external systems — check a database, call an API, run a linter, search documentation. Tool use closes this gap.
Design
Core Interface
public interface IToolProvider
{
IReadOnlyList<AIFunction> GetTools();
}
CouncilBuilder Integration
// Global tools available to all members
councilBuilder.WithTools(IToolProvider toolProvider);
councilBuilder.WithTools(params AIFunction[] functions);
// Per-member tools
councilBuilder.AddMember("Reviewer", provider, systemPrompt,
tools: new[] { searchCodeTool, lintTool });
Execution Flow
- Member generates response with tool call request (via
AIFunctionCallContent)
CouncilExecutor detects tool call in response
- Executor invokes
AIFunction with provided arguments
- Tool result appended to member's context as
AIFunctionResultContent
- Member generates final response incorporating tool result
DebateRound includes ToolCallLog entries
Result Additions
public record ToolCallLog
{
public string MemberRole { get; init; }
public string FunctionName { get; init; }
public string Arguments { get; init; } // JSON
public string Result { get; init; } // JSON
public TimeSpan Duration { get; init; }
public bool Success { get; init; }
}
// DebateRound gains:
public IReadOnlyList<ToolCallLog> ToolCalls { get; init; }
Built-in Tool Providers
| Provider |
Description |
FileSystemToolProvider |
Read files, list directories (sandboxed to a root path) |
HttpToolProvider |
HTTP GET/POST to configured endpoints |
McpToolProvider |
Wrap any MCP (Model Context Protocol) server as tools |
Tasks
Acceptance Criteria
Labels
enhancement, v10.4.0, AI
Overview
Version: v10.4.0 Intelligence & DX
Effort: L · 5–8 days
Branch:
feature/i01-function-callingEnable council members to call external tools (functions) during their debate turns, using the
AIFunctionabstraction fromMicrosoft.Extensions.AI.Background
Currently council members only reason and respond with text. In many real-world scenarios (code review, requirements analysis, risk assessment) members need to query external systems — check a database, call an API, run a linter, search documentation. Tool use closes this gap.
Design
Core Interface
CouncilBuilder Integration
Execution Flow
AIFunctionCallContent)CouncilExecutordetects tool call in responseAIFunctionwith provided argumentsAIFunctionResultContentDebateRoundincludesToolCallLogentriesResult Additions
Built-in Tool Providers
FileSystemToolProviderHttpToolProviderMcpToolProviderTasks
IToolProviderinDelibera.Core.InterfacesCouncilExecutor.ExecuteMemberTurnAsyncWithTools()toICouncilBuilderandCouncilBuilderCouncilMemberToolCallLogtoDebateRoundFileSystemToolProviderHttpToolProviderMcpToolProvider(delegates to existingIOperatorbridge)WithTimeout— tool calls count against overall debate timeoutToolCallExecutespanToolCallExample.csinDelibera.ExamplesDelibera.Server—DebateRequestgainsToolscollectiondocs/tool-use.mdwith architecture diagram and examplesAcceptance Criteria
CouncilBuilder.WithTools(...)compiles and works end-to-endDebateRound.ToolCallsFileSystemToolProviderandHttpToolProviderwork in examplesMcpToolProviderbridges correctly to existingIOperatorimplementationsToolCallExecuteemitted for each callToolCallExample.csruns successfullyLabels
enhancement,v10.4.0,AI