> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.basement.chat/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.basement.chat/_mcp/server.

# Tools

The Gateway has one set of tools. An agent calls them through MCP. A program calls the same tools through the SDKs or the HTTP API, where each tool is one operation.

The **Needs** column says what the key's access level must allow. See [Keys and access levels](/concepts/keys-and-access-levels).

## Identity

| Tool     | What it does                                                                    | Needs   |
| -------- | ------------------------------------------------------------------------------- | ------- |
| `whoami` | Answers the organization, the key's name and prefix, its scopes and its expiry. | Any key |

## Documents

| Tool                  | What it does                                                             | Needs            |
| --------------------- | ------------------------------------------------------------------------ | ---------------- |
| `list_docs`           | Lists the documents: ID, title, version.                                 | Documents        |
| `read_doc`            | Reads a document's markdown. Basement records the version that was read. | Documents        |
| `list_doc_versions`   | Lists a document's versions, newest first.                               | Documents        |
| `create_doc`          | Creates a document.                                                      | Documents, write |
| `update_doc`          | Replaces a document's body. Makes a new version.                         | Documents, write |
| `edit_doc`            | Replaces one piece of text in a document. Makes a new version.           | Documents, write |
| `rename_doc`          | Renames a document.                                                      | Documents, write |
| `delete_doc`          | Deletes a document.                                                      | Documents, write |
| `restore_doc_version` | Restores an earlier version.                                             | Documents, write |
| `share_doc`           | Turns a document's public link on or off.                                | Documents, write |

## Files, skills and folders

| Tool                   | What it does                                                                        | Needs            |
| ---------------------- | ----------------------------------------------------------------------------------- | ---------------- |
| `list_files`           | Lists the files in the folders the key can use.                                     | Documents        |
| `read_file`            | Reads a file's details and a download link. For a small text file, also its text.   | Documents        |
| `list_skills`          | Lists the skills in the folders the key can use.                                    | Documents        |
| `list_folders`         | Lists the folders the key can use, and its access to each.                          | Documents        |
| `write_file`           | Uploads a file of up to 5 MB, or a new version of one.                              | Documents, write |
| `edit_file`            | Replaces one piece of text in a text file.                                          | Documents, write |
| `write_skill`          | Creates a skill, or a new version of one.                                           | Documents, write |
| `edit_skill`           | Replaces one piece of text in a skill.                                              | Documents, write |
| `create_folder`        | Creates a private folder.                                                           | Documents, write |
| `share_folder`         | Asks to share a folder. Basement emails a code to the person who connected the key. | Documents, write |
| `confirm_folder_share` | Applies the share with that code.                                                   | Documents, write |

## Search and text

| Tool         | What it does                                                               | Needs     |
| ------------ | -------------------------------------------------------------------------- | --------- |
| `search`     | Finds documents, files and skills. Answers up to 25 items.                 | Documents |
| `find_text`  | Finds a phrase in one document or text file. Answers the lines that match. | Documents |
| `read_lines` | Reads a range of lines of a document or a text file.                       | Documents |

## Tasks

| Tool          | What it does                                                 | Needs        |
| ------------- | ------------------------------------------------------------ | ------------ |
| `list_tasks`  | Lists the tasks, open ones by default.                       | Tasks        |
| `create_task` | Creates a task.                                              | Tasks, write |
| `update_task` | Changes a task's status, title or due date, or reassigns it. | Tasks, write |

## Connected services

| Tool                      | What it does                                               | Needs                                            |
| ------------------------- | ---------------------------------------------------------- | ------------------------------------------------ |
| `list_connected_services` | Lists the services and connections the key can use.        | A service                                        |
| `list_service_tools`      | Lists the tools of one service, each marked read or write. | That service                                     |
| `execute_service_tool`    | Runs a tool of a service.                                  | That service. A write tool needs read and write. |

The tools of each service come from the service itself. Call `list_service_tools` to see them with their arguments. See [Connected services](/concepts/connected-services).

## Names in the SDKs

In the SDKs, each tool is a method. The table shows a few; the [API Reference](/api-reference) lists all of them.

| Tool                   | TypeScript                                           | Python                                                    |
| ---------------------- | ---------------------------------------------------- | --------------------------------------------------------- |
| `whoami`               | `basement.whoami()`                                  | `basement.whoami()`                                       |
| `list_docs`            | `basement.docs.list()`                               | `basement.docs.list()`                                    |
| `read_doc`             | `basement.docs.read({ docId })`                      | `basement.docs.read(doc_id=...)`                          |
| `search`               | `basement.search({ query })`                         | `basement.search(query=...)`                              |
| `find_text`            | `basement.text.find({ docId, query })`               | `basement.text.find(doc_id=..., query=...)`               |
| `create_task`          | `basement.tasks.create({ title })`                   | `basement.tasks.create(title=...)`                        |
| `execute_service_tool` | `basement.services.execute({ toolSlug, arguments })` | `basement.services.execute(tool_slug=..., arguments=...)` |