Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions internal/agent/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,28 +344,24 @@ func (c *coordinator) buildTools(ctx context.Context, agent config.Agent) ([]fan
}
}

mcpTools := tools.GetMCPTools(context.Background(), c.permissions, c.cfg)

for _, mcpTool := range mcpTools {
for _, tool := range tools.GetMCPTools(c.permissions, c.cfg.WorkingDir()) {
if agent.AllowedMCP == nil {
// No MCP restrictions
filteredTools = append(filteredTools, mcpTool)
} else if len(agent.AllowedMCP) == 0 {
// no mcps allowed
filteredTools = append(filteredTools, tool)
continue
}
if len(agent.AllowedMCP) == 0 {
// No MCPs allowed
slog.Warn("MCPs not allowed")
break
}

for mcp, tools := range agent.AllowedMCP {
if mcp == mcpTool.MCP() {
if len(tools) == 0 {
filteredTools = append(filteredTools, mcpTool)
}
for _, t := range tools {
if t == mcpTool.MCPToolName() {
filteredTools = append(filteredTools, mcpTool)
}
}
break
if mcp != tool.MCP() {
continue
}
if len(tools) == 0 || slices.Contains(tools, tool.MCPToolName()) {
filteredTools = append(filteredTools, tool)
}
}
}
Expand Down
6 changes: 0 additions & 6 deletions internal/agent/tools/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ type FetchPermissionsParams struct {
Timeout int `json:"timeout,omitempty"`
}

type fetchTool struct {
client *http.Client
permissions permission.Service
workingDir string
}

const FetchToolName = "fetch"

//go:embed fetch.md
Expand Down
Loading
Loading