Catalog
catalog
In-memory catalog backing the four MCP facade meta-tools.
ToolCatalog wraps the discover_tools() dict and provides the four
operations the facade exposes:
- :meth:
search— keyword/tag lookup over name + summary + tags + domain; - :meth:
describe— the full invocation contract (typed params + docstring); - :meth:
call— execute a tool by name and return itsToolResult.text(falling back to the flatteneddatadict when there is no text); - :meth:
capabilities— compact per-domain grouping.
Discovery metadata (expose_directly / domain / tags) is read via
:func:axm.tools.base.tool_metadata, so both AXMTool subclasses and
structural tools work unchanged. Typed parameters reuse
:func:axm_mcp.schema.signature_params — the exact introspection MCPServer
itself uses — so axm_describe and the per-tool MCP schema agree.
ToolCatalog
Searchable index over discovered axm.tools entries.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tools
|
dict[str, ToolEntry]
|
The |
required |
shared_mode
|
bool
|
Arm per-session write-contract enforcement for every facade wrapper when true. |
False
|
write_contract_resolver
|
Callable[[], WriteContract | None] | None
|
Resolve the emitting session's contract for each facade call; dedicated mode keeps the environment-backed fallback. |
None
|
Source code in packages/axm-mcp/src/axm_mcp/facade/catalog.py
| Python | |
|---|---|
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 | |
acall(name, arguments=None)
async
Execute name through the lock-aware async wrapper.
The HTTP-mode entry point: it awaits the async wrapper, so the
per-key lock (git_* by repo path, protocol_* by session) is
held and the sync tool body runs on a worker thread via
asyncio.to_thread — the event loop of the shared server is never
blocked. In stdio mode the async wrapper simply runs the tool inline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Tool name. |
required |
arguments
|
dict[str, object] | None
|
Keyword arguments for the tool. |
None
|
Returns:
| Type | Description |
|---|---|
str
|
The rendered text output (same contract as :meth: |
Raises:
| Type | Description |
|---|---|
UnknownToolError
|
If name is not in the catalog. |
Source code in packages/axm-mcp/src/axm_mcp/facade/catalog.py
call(name, arguments=None)
Execute name synchronously and return its text output.
Delegates to the same sync wrapper the direct MCP path registers
(built by :func:axm_mcp.wrapping.build_wrappers), so axm_call
inherits its full contract: kwarg unwrapping, implicit-path warning,
tracing, exception flattening (a raised ValueError/OSError
becomes {success: False, error: ...} — never a raw MCP protocol
error), and the success-only text short-circuit. This is the
single execution path.
The per-key concurrency lock (git_*/protocol_* in HTTP mode)
is only held via :meth:acall; call is the sync entry used in
stdio mode and by tests.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Tool name. |
required |
arguments
|
dict[str, object] | None
|
Keyword arguments for the tool. |
None
|
Returns:
| Type | Description |
|---|---|
str
|
The tool's |
str
|
readable rendering of the shared flattened envelope. |
Raises:
| Type | Description |
|---|---|
UnknownToolError
|
If name is not in the catalog. |
Source code in packages/axm-mcp/src/axm_mcp/facade/catalog.py
capabilities(domain=None)
Group tool names by domain.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
domain
|
str | None
|
When given, return only that domain's tools. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, list[str]]
|
|
dict[str, list[str]]
|
under the |
Source code in packages/axm-mcp/src/axm_mcp/facade/catalog.py
describe(name)
Return the full invocation contract for name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Tool name. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, object]
|
|
dict[str, object]
|
param is |
Raises:
| Type | Description |
|---|---|
UnknownToolError
|
If name is not in the catalog. |
Source code in packages/axm-mcp/src/axm_mcp/facade/catalog.py
hot_path()
Names of tools opting into direct MCP exposure (expose_directly).
Source code in packages/axm-mcp/src/axm_mcp/facade/catalog.py
names()
param_hint(name)
Human-readable list of accepted params for name (for error text).
Source code in packages/axm-mcp/src/axm_mcp/facade/catalog.py
search(query, domain=None, limit=_DEFAULT_LIMIT)
Find tools whose name, summary, tags or domain match query.
Matching is case-insensitive substring (the deliberately-simple v1; tags carry discovery quality). An empty query lists everything (optionally scoped by domain), which makes the facade browsable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Substring to look for. Empty matches all. |
required |
domain
|
str | None
|
Optional exact-match domain filter. |
None
|
limit
|
int
|
Maximum number of results. |
_DEFAULT_LIMIT
|
Returns:
| Type | Description |
|---|---|
list[dict[str, object]]
|
A list of |
Source code in packages/axm-mcp/src/axm_mcp/facade/catalog.py
UnknownToolError
render_capabilities(domains)
Render every domain and its tools on a single line.
Source code in packages/axm-mcp/src/axm_mcp/facade/catalog.py
render_describe(spec)
Render a tool invocation contract as compact facade text.
Source code in packages/axm-mcp/src/axm_mcp/facade/catalog.py
render_list_tools(tools)
Render a compact full tool listing.
Source code in packages/axm-mcp/src/axm_mcp/facade/catalog.py
| Python | |
|---|---|
render_search(results)
Render search hits with their discovery metadata on one line each.
Source code in packages/axm-mcp/src/axm_mcp/facade/catalog.py
render_unknown(name, catalog)
Render a compact unknown-tool diagnostic with near matches.