# Read and search notes

> Read any note in the vault, list folders and search their text.

Not every note is a row, so the operations on this page work on the whole vault: plain notes and rows alike. The vault has three actors, two classic films, a viewing and two plain notes.

## Read a note

`read_note` returns a note’s Markdown in `content`, with its front matter, tags, file dates and size, parsed.

**`read_note`**

```json
{ "path": "Notes/Film night.md" }
```

Answer:

```json
{
  "path": "Notes/Film night.md",
  "content": "---\ntags: [films]\n---\n# Film night\n\nEvery other Friday. Next up: [[Charade]]. October’s theme is [[Cary Grant]].\n",
  "front_matter": { "tags": ["films"] },
  "tags": ["films"],
  "modified_at": "<date-time>",
  "created_at": "<date-time>",
  "size": 115
}
```

## List a folder

`list_folder` lists a folder’s sub-folders and files, as vault paths, and `""` is the vault root. The listing hides the files and folders whose names start with a dot, such as `.obsidian`.

**`list_folder`**

```json
{ "folder": "" }
```

Answer:

```json
{ "folder": "", "folders": ["Notes", "datanotes"], "files": [] }
```

**`list_folder`**

```json
{ "folder": "datanotes/main/public" }
```

Answer:

```json
{
  "folder": "datanotes/main/public",
  "folders": [
    "datanotes/main/public/actor",
    "datanotes/main/public/film",
    "datanotes/main/public/watch"
  ],
  "files": []
}
```

## Search text

`search_notes` finds notes whose path or text contains every word of the query, ignoring case and accents. It returns the matching passages.

**`search_notes`**

```json
{ "query": "grant", "context_length": 30 }
```

Answer (62 lines)

```json
{
  "query": "grant",
  "results": [
    {
      "path": "datanotes/main/public/actor/Cary Grant.md",
      "score": 6,
      "matches": [
        {
          "start": 81,
          "end": 86,
          "context": "-9e83-110412d6d2ca\nname: Cary Grant\n---\n\n"
        }
      ]
    },
    {
      "path": "datanotes/main/public/film/Charade.md",
      "score": 2,
      "matches": [
        {
          "start": 102,
          "end": 107,
          "context": "le: Charade\ncast:\n  - \"[[Cary Grant]]\"\n  - \"[[Audrey Hepburn]]\"\n-"
        },
        {
          "start": 147,
          "end": 152,
          "context": "[Audrey Hepburn]]\"\n---\n[[Cary Grant]] again, 23 years after [[His"
        }
      ]
    },
    {
      "path": "datanotes/main/public/film/His Girl Friday.md",
      "score": 1,
      "matches": [
        {
          "start": 110,
          "end": 115,
          "context": "Girl Friday\ncast:\n  - \"[[Cary Grant]]\"\n  - \"[[Rosalind Russell]]\""
        }
      ]
    },
    {
      "path": "Notes/Film night.md",
      "score": 1,
      "matches": [
        {
          "start": 104,
          "end": 109,
          "context": "]]. October’s theme is [[Cary Grant]].\n"
        }
      ]
    },
    {
      "path": "Notes/Rewatch ideas.md",
      "score": 1,
      "matches": [
        { "start": 7, "end": 12, "context": "A Cary Grant weekend: every film with him," }
      ]
    }
  ],
  "total": 5
}
```
