AS AgentScopeAPI 手册 / API Reference

ToolsConfig

@JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonIgnoreProperties(ignoreUnknown = true) public class ToolsConfig
源码Source io/agentscope/harness/agent/tools/ToolsConfig.java:41–99

工具配置,保存相关配置项。位于 io.agentscope.harness.agent.tools 包。核心成员包括 isStrictAllow、setStrictAllow、isDefaultToolsEnabled、setDefaultToolsEnabled、getAllow、setAllow。

Workspace-level tool configuration loaded from workspace/tools.json.

Two responsibilities:

  • #allow / #deny — filter the product catalog tool surface (filesystem, shell, web, …).

  • #mcpServers — declare additional tools served by external MCP servers.

Filter semantics: when allow is non-empty, catalogued tools not listed are removed; HarnessPlatformTools (subagents, teams, tasks, plan, skills, memory helpers, …) always survive allow. deny always wins. Empty/absent values mean "no filtering on this side".

方法摘要Method Summary

方法Method说明Description
public boolean isStrictAllow()
判断是否 `isStrictAllow`。
Returns whether the strict allow.
public void setStrictAllow(boolean value)
设置 `setStrictAllow`。
Sets the strict allow.
public boolean isDefaultToolsEnabled()
判断是否默认工具已启用。
Returns whether the default tools enabled.
public void setDefaultToolsEnabled(boolean value)
设置默认工具已启用。
Sets the default tools enabled.
public List<String> getAllow()
获取 `getAllow`。
Returns the allow.
public void setAllow(List<String> allow)
设置 `setAllow`。
Sets the allow.
public List<String> getDeny()
获取拒绝。
Returns the deny.
public void setDeny(List<String> deny)
设置拒绝。
Sets the deny.
public Map<String, McpServerConfig> getMcpServers()
获取 `getMcpServers`。
Returns the mcp servers.
public void setMcpServers(Map<String, McpServerConfig> mcpServers)
设置 `setMcpServers`。
Sets the mcp servers.

方法详情Method Detail

isStrictAllow

public boolean isStrictAllow()

判断是否 isStrictAllow。

Returns whether the strict allow.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/harness/agent/tools/ToolsConfig.java:60–62

setStrictAllow

public void setStrictAllow(boolean value)

设置 setStrictAllow。

Sets the strict allow.

参数Parameters
名称Name类型Type说明Description
valueboolean值(类型 `boolean`)。The value.
源码Source io/agentscope/harness/agent/tools/ToolsConfig.java:64–66

isDefaultToolsEnabled

public boolean isDefaultToolsEnabled()

判断是否默认工具已启用。

Returns whether the default tools enabled.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/harness/agent/tools/ToolsConfig.java:68–70

setDefaultToolsEnabled

public void setDefaultToolsEnabled(boolean value)

设置默认工具已启用。

Sets the default tools enabled.

参数Parameters
名称Name类型Type说明Description
valueboolean值(类型 `boolean`)。The value.
源码Source io/agentscope/harness/agent/tools/ToolsConfig.java:72–74

getAllow

public List<String> getAllow()

获取 getAllow。

Returns the allow.

返回Returns List<String>
返回列出。Returns list.
源码Source io/agentscope/harness/agent/tools/ToolsConfig.java:76–78

setAllow

public void setAllow(List<String> allow)

设置 setAllow。

Sets the allow.

参数Parameters
名称Name类型Type说明Description
allowList<String>allow(类型 `List`)。The allow.
源码Source io/agentscope/harness/agent/tools/ToolsConfig.java:80–82

getDeny

public List<String> getDeny()

获取拒绝。

Returns the deny.

返回Returns List<String>
返回列出。Returns list.
源码Source io/agentscope/harness/agent/tools/ToolsConfig.java:84–86

setDeny

public void setDeny(List<String> deny)

设置拒绝。

Sets the deny.

参数Parameters
名称Name类型Type说明Description
denyList<String>拒绝(类型 `List`)。The deny.
源码Source io/agentscope/harness/agent/tools/ToolsConfig.java:88–90

getMcpServers

public Map<String, McpServerConfig> getMcpServers()

获取 getMcpServers。

Returns the mcp servers.

返回Returns Map<String, McpServerConfig>
返回映射。Returns map.
源码Source io/agentscope/harness/agent/tools/ToolsConfig.java:92–94

setMcpServers

public void setMcpServers(Map<String, McpServerConfig> mcpServers)

设置 setMcpServers。

Sets the mcp servers.

参数Parameters
名称Name类型Type说明Description
mcpServersMap<String, McpServerConfig>MCP Servers(类型 `Map`)。The mcp servers.
源码Source io/agentscope/harness/agent/tools/ToolsConfig.java:96–98
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.