Skip to content

Commit 6af9871

Browse files
committed
Introduce refresh_gists tool
1 parent 25926ff commit 6af9871

File tree

6 files changed

+47
-3
lines changed

6 files changed

+47
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 📆 v0.4.5 (06/16/2025)
2+
3+
- Added the `refresh_gists` tool
4+
15
## 📆 v0.4.4 (06/12/2025)
26

37
- Updated README with instructions for setting up GistPad with VS Code 1.101.0

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ An MCP server for managing and sharing your personal knowledge, daily notes, and
1212

1313
1. Using VS Code?
1414

15-
1. Simply install the [GistPad extension](https://aka.ms/gistpad) and sign-in with your GitHub account. After that, you can begin using GistPad from Copilot chat (in `Agent` mode) without doing any extra setup or token management 💪
15+
1. Install the [GistPad extension](https://aka.ms/gistpad) and then reload VS Code
1616

1717
> _Note: This requires VS Code 1.101.0+, so if you're on an older version, it's time to upgrade!_
1818
19+
1. Open the `GistPad` tab and sign-in with your GitHub account. After that, you can begin using GistPad from Copilot chat (in `Agent` mode) without doing any extra setup or token management 💪
20+
1921
1. Other MCP clients...
2022

2123
1. Generate a personal access token that includes _only_ the `gist` scope: https://github.com/settings/tokens/new
@@ -78,6 +80,7 @@ Once your client it setup, you can start having fun with gists + MCP! 🥳 For e
7880
- `delete_gist` - Delete a gist by ID.
7981
- `update_gist_description` - Update a gist's description by ID.
8082
- `duplicate_gist` - Create a copy of an existing gist with all its files.
83+
- `refresh_gists` - Reload your gist lists, ignoring any cached data.
8184

8285
### File management
8386

@@ -144,3 +147,7 @@ The `gistpad-mcp` CLI accepts the following optional flags:
144147
- `--starred` - Include starred gists in the list of MCP resources _(Note: The `list_starred_gists` tool is always available)_
145148
- `--daily` - Include daily notes in the list of MCP resources _(Note: The `list_daily_notes` tool is always available)_
146149
- `--markdown` - Filter the list of gists that are returned, to only those that are composed of Markdown files.
150+
151+
## 🧰 Troubleshooting
152+
153+
- <u>Not seeing a gist in your list?</u> Rhe GistPad MCP server caches your gist list during the lifetime of its server process (for performance reasons), and so if you add/edit/delete a gist externally, you may need to tell GistPad MCP to refresh itself. You can do this by triggering the `refresh_gists` tool.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gistpad-mcp",
3-
"version": "0.4.4",
3+
"version": "0.4.5",
44
"description": "An MCP server for managing your personal knowledge, daily notes, and reusable prompts via GitHub Gists.",
55
"type": "module",
66
"bin": {

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class GistpadServer {
4747
this.server = new Server(
4848
{
4949
name: "gistpad",
50-
version: "0.4.4",
50+
version: "0.4.5",
5151
},
5252
{
5353
capabilities: {

src/tools/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import daily from "./daily.js";
55
import fileTools from "./files.js";
66
import gistTools from "./gist.js";
77
import promptTools from "./prompts.js";
8+
import refreshTools from "./refresh.js";
89
import starTools from "./star.js";
910

1011
const tools: ToolModule[] = [
@@ -14,6 +15,7 @@ const tools: ToolModule[] = [
1415
fileTools,
1516
gistTools,
1617
promptTools,
18+
refreshTools,
1719
starTools,
1820
];
1921

src/tools/refresh.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { ToolModule } from "../types.js";
2+
3+
export default {
4+
definitions: [
5+
{
6+
name: "refresh_gists",
7+
description:
8+
"Reload the gist and starred gist stores, bypassing the cache",
9+
inputSchema: {
10+
type: "object",
11+
properties: {},
12+
required: [],
13+
},
14+
},
15+
],
16+
17+
handlers: {
18+
refresh_gists: async (_, context) => {
19+
context.gistStore.invalidate();
20+
context.starredGistStore.invalidate();
21+
22+
await Promise.all([
23+
context.gistStore.getAll(),
24+
context.starredGistStore.getAll(),
25+
]);
26+
27+
await context.server.sendResourceListChanged();
28+
return "Gists refreshed!";
29+
},
30+
},
31+
} as ToolModule;

0 commit comments

Comments
 (0)