# Basic-memory MCP Tools

Available tools for the basic-memory MCP server.

## Tool Discovery

Agents can discover these tools by exploring the filesystem:

```typescript
import { readdirSync } from 'fs';
const tools = readdirSync('./src/servers/basic-memory/');
console.log(tools); // List all available tools
```

## Available Tools

### writeNote

**Description:** Create or update a markdown note

**Parameters:**
- `title` (required): The note title
- `content` (required): Markdown content for the note
- `folder` (required): Destination folder path
- `project` (optional): Project name (optional)
- `entityType` (optional): Entity type (default: "note")
- `tags` (optional): List of tags

**Usage:**
```typescript
import { writeNote } from './src/servers/basic-memory/writeNote.js';

const result = await writeNote({
  title: 'value',
  content: 'value',
  folder: 'value',
});
```

### readNote

**Description:** Read a markdown note by title or permalink

**Parameters:**
- `identifier` (required): Note title or permalink
- `page` (optional): Page number (default: 1)
- `pageSize` (optional): Page size (default: 10)
- `project` (optional): Project name (optional)

**Usage:**
```typescript
import { readNote } from './src/servers/basic-memory/readNote.js';

const result = await readNote({
  identifier: 'value',
});
```

### searchNotes

**Description:** Search across all content in the knowledge base

**Parameters:**
- `query` (required): Search query
- `page` (optional): Page number (default: 1)
- `pageSize` (optional): Page size (default: 10)
- `project` (optional): Project name (optional)
- `searchType` (optional): Search type (default: "text")
- `types` (optional): Filter by types
- `entityTypes` (optional): Filter by entity types
- `afterDate` (optional): Filter by date

**Usage:**
```typescript
import { searchNotes } from './src/servers/basic-memory/searchNotes.js';

const result = await searchNotes({
  query: 'value',
});
```

### editNote

**Description:** Edit an existing markdown note

**Parameters:**
- `identifier` (required): Note title or permalink
- `operation` (required): Operation: append, prepend, find_replace, or replace_section
- `content` (required): Content to add/replace
- `findText` (optional): Text to find (for find_replace)
- `section` (optional): Section to replace
- `expectedReplacements` (optional): Expected number of replacements (default: 1)
- `project` (optional): Project name (optional)

**Usage:**
```typescript
import { editNote } from './src/servers/basic-memory/editNote.js';

const result = await editNote({
  identifier: 'value',
  operation: 'value',
  content: 'value',
});
```

### listDirectory

**Description:** List directory contents with filtering and depth control

**Parameters:**
- `dirName` (optional): Directory name (default: "/")
- `depth` (optional): Directory depth (default: 1)
- `fileNameGlob` (optional): File name glob pattern
- `project` (optional): Project name (optional)

**Usage:**
```typescript
import { listDirectory } from './src/servers/basic-memory/listDirectory.js';

const result = await listDirectory({
});
```

### deleteNote

**Description:** Delete a note by title or permalink

**Parameters:**
- `identifier` (required): Note title or permalink
- `project` (optional): Project name (optional)

**Usage:**
```typescript
import { deleteNote } from './src/servers/basic-memory/deleteNote.js';

const result = await deleteNote({
  identifier: 'value',
});
```

### moveNote

**Description:** Move a note to a new location

**Parameters:**
- `identifier` (required): Note title or permalink
- `destinationPath` (required): Destination path
- `project` (optional): Project name (optional)

**Usage:**
```typescript
import { moveNote } from './src/servers/basic-memory/moveNote.js';

const result = await moveNote({
  identifier: 'value',
  destinationPath: 'value',
});
```

## Progressive Disclosure

Following the MCP code execution pattern, agents:
1. List tools in this directory
2. Read specific tool definitions on-demand
3. Use only the tools needed for the current task

This approach reduces token usage by 70-95% compared to loading all tool definitions upfront.
