Every tool description now leads with what the tool does AND when to reach for it, since MCP clients rank tools by that text. Per-parameter prose moved onto the parameters as [Description], exhaustive result-shape enumerations and design/history rationale dropped, and the repeated boilerplate clauses (lean-task-ref, batch cap, refused-while-Running) pulled into McpToolDocs, which also documents the style for future tools. Tool-level description text: 20494 -> 13605 chars (-34%); combined with the new parameter descriptions 18517 (-10%). Closes gaps that caused wrong calls rather than just verbose ones: - list_task_attachments returns metadata only, no file content - run_task_now shares continue_task's single override slot and throws when busy - list_runs is ordered oldest-first and feeds get_run - workingDir on create_list/update_list is an existing local git repo path, unvalidated until the first task run - get_task_worktree's behind=0 also means the main ref was unreachable Removes get_task_status_values: a whole tool entry for static reference text. GetTask's description is now the canonical place for status meanings.
34 lines
1.5 KiB
C#
34 lines
1.5 KiB
C#
using System.ComponentModel;
|
|
using ClaudeDo.Data;
|
|
using ClaudeDo.Data.Repositories;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using ModelContextProtocol.Server;
|
|
|
|
namespace ClaudeDo.Worker.External;
|
|
|
|
public sealed record AppSettingsReadDto(
|
|
string DefaultModel, int DefaultMaxTurns, string DefaultPermissionMode,
|
|
int MaxParallelExecutions,
|
|
string WorktreeStrategy, string? CentralWorktreeRoot,
|
|
bool WorktreeAutoCleanupEnabled, int WorktreeAutoCleanupDays);
|
|
|
|
[McpServerToolType]
|
|
public sealed class AppSettingsMcpTools
|
|
{
|
|
private readonly IDbContextFactory<ClaudeDoDbContext> _dbFactory;
|
|
|
|
public AppSettingsMcpTools(IDbContextFactory<ClaudeDoDbContext> dbFactory) => _dbFactory = dbFactory;
|
|
|
|
[McpServerTool, Description("Read the worker's global defaults (model, max turns, permission mode, max parallel execution slots, worktree strategy) that apply when a task/list doesn't override them. Read-only.")]
|
|
public async Task<AppSettingsReadDto> GetAppSettings(CancellationToken cancellationToken)
|
|
{
|
|
using var ctx = await _dbFactory.CreateDbContextAsync(cancellationToken);
|
|
var row = await new AppSettingsRepository(ctx).GetAsync(cancellationToken);
|
|
return new AppSettingsReadDto(
|
|
row.DefaultModel, row.DefaultMaxTurns, row.DefaultPermissionMode,
|
|
row.MaxParallelExecutions,
|
|
row.WorktreeStrategy, row.CentralWorktreeRoot,
|
|
row.WorktreeAutoCleanupEnabled, row.WorktreeAutoCleanupDays);
|
|
}
|
|
}
|