MCPcopy Create free account
hub / github.com/IBM/mcp-cli / ToolConfig

Class ToolConfig

src/mcp_cli/config/models.py:83–120  ·  view source on GitHub ↗

Tool behavior configuration. No more magic numbers!

Source from the content-addressed store, hash-verified

81
82
83class ToolConfig(BaseModel):
84 """Tool behavior configuration.
85
86 No more magic numbers!
87 """
88
89 include_tools: list[str] | None = Field(
90 default=None,
91 description="Whitelist of tool names (None = all)",
92 )
93 exclude_tools: list[str] | None = Field(
94 default=None,
95 description="Blacklist of tool names",
96 )
97 dynamic_tools_enabled: bool = Field(
98 default=DEFAULT_DYNAMIC_TOOLS_ENABLED,
99 description="Enable dynamic tool discovery",
100 )
101 confirm_tools: bool = Field(
102 default=DEFAULT_CONFIRM_TOOLS,
103 description="Require confirmation before execution",
104 )
105 max_concurrency: int = Field(
106 default=DEFAULT_MAX_TOOL_CONCURRENCY,
107 gt=0,
108 le=100,
109 description="Max concurrent tool executions",
110 )
111
112 model_config = {"frozen": True}
113
114 @field_validator("include_tools", "exclude_tools")
115 @classmethod
116 def validate_tool_lists(cls, v: list[str] | None) -> list[str] | None:
117 """Ensure tool lists are non-empty if provided."""
118 if v is not None and len(v) == 0:
119 return None
120 return v
121
122
123class VaultConfig(BaseModel):

Callers 6

get_tool_configMethod · 0.90
test_default_valuesMethod · 0.90
test_custom_valuesMethod · 0.90
load_from_fileMethod · 0.85

Calls

no outgoing calls

Tested by 4

test_default_valuesMethod · 0.72
test_custom_valuesMethod · 0.72