# mcp


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

The same [`cmd`](https://vedicreader.github.io/vishalakshi/cli.html#cmd)
the CLI uses: a
[`Vault`](https://vedicreader.github.io/vishalakshi/core.html#vault)
method becomes a tool whose schema and description are the method’s own
signature and docstring. An agent that can write notes back into the
same vault it reads from accumulates rather than restarts.

------------------------------------------------------------------------

<a
href="https://github.com/vedicreader/vishalakshi/blob/main/vishalakshi/cli.py#L57"
target="_blank" style="float:right; font-size:smaller">source</a>

### main

``` python
def main():
```

*Entry point for `vishalakshi-mcp`. stdio by default; `--http` for
Streamable HTTP.*

------------------------------------------------------------------------

<a
href="https://github.com/vedicreader/vishalakshi/blob/main/vishalakshi/mcp.py#L33"
target="_blank" style="float:right; font-size:smaller">source</a>

### as_tool

``` python
def as_tool(
    name:str
):
```

*Register one
[`Vault`](https://vedicreader.github.io/vishalakshi/core.html#vault)
method as an MCP tool, forcing its result through JSON.*

## Try it

``` python
tools = {t.name: t for t in await mcp.list_tools()}
len(tools), tools['context'].description[:120]
```

``` python
test_eq(sorted(tools), sorted(TOOLS))
test_eq(tools['find'].inputSchema['properties']['limit']['default'], 10)
test_eq(tools['find'].inputSchema['required'], ['q'])
```
