Skip to content

Commit 239f2a7

Browse files
committed
perf: strip compact boilerplate from tool descriptions, add server instructions
Moved the compact mode explanation from 7 individual tool descriptions to a single server-level `instructions` string sent once at session start. - Tool descriptions now describe what the tool does, not response formatting - compact property description shortened: "Return raw uncompacted data" - Server version updated to 1.4.0 in constructor Saves ~525 chars (~130 tokens) per tools/list call with zero functionality loss.
1 parent 385219e commit 239f2a7

1 file changed

Lines changed: 14 additions & 13 deletions

File tree

src/index.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@ dotenv.config({ path: join(__dirname, '..', '.env') });
3636
const server = new Server(
3737
{
3838
name: 'gravitymcp',
39-
version: '1.0.0'
39+
version: '1.4.0'
4040
},
4141
{
4242
capabilities: {
4343
tools: {}
44-
}
44+
},
45+
instructions: 'Gravity Forms MCP server. All responses strip null and empty values by default for minimal token usage. Pass compact=false on any tool to get full raw data. Entry tools also strip plugin-added meta keys; use compact=false to include them.'
4546
}
4647
);
4748

@@ -139,7 +140,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
139140
// Forms Management (6 tools)
140141
{
141142
name: 'gf_list_forms',
142-
description: 'List all forms. Omits null/empty values by default; pass compact=false for raw data.',
143+
description: 'List all forms with optional search and pagination.',
143144
annotations: { readOnlyHint: true, openWorldHint: true },
144145
inputSchema: {
145146
type: 'object',
@@ -149,19 +150,19 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
149150
items: { type: 'number' },
150151
description: 'Form IDs to include'
151152
},
152-
compact: { type: 'boolean', description: 'Strip null/empty values (default true)', default: true }
153+
compact: { type: 'boolean', description: 'Return raw uncompacted data', default: true }
153154
}
154155
}
155156
},
156157
{
157158
name: 'gf_get_form',
158-
description: 'Get a form by ID. Omits null/empty values by default; pass compact=false for raw data.',
159+
description: 'Get a form by ID with full field configuration.',
159160
annotations: { readOnlyHint: true, openWorldHint: true },
160161
inputSchema: {
161162
type: 'object',
162163
properties: {
163164
id: { type: 'number', description: 'Form ID' },
164-
compact: { type: 'boolean', description: 'Strip null/empty values (default true)', default: true }
165+
compact: { type: 'boolean', description: 'Return raw uncompacted data', default: true }
165166
},
166167
required: ['id']
167168
}
@@ -241,7 +242,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
241242
// Entries Management (5 tools)
242243
{
243244
name: 'gf_list_entries',
244-
description: 'List/search entries. Strips null/empty values and plugin entry meta by default; pass compact=false for full raw data.',
245+
description: 'List/search entries with filtering, sorting, and pagination.',
245246
annotations: { readOnlyHint: true, openWorldHint: true },
246247
inputSchema: {
247248
type: 'object',
@@ -307,19 +308,19 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
307308
current_page: { type: 'number' }
308309
}
309310
},
310-
compact: { type: 'boolean', description: 'Strip null/empty values (default true)', default: true }
311+
compact: { type: 'boolean', description: 'Return raw uncompacted data', default: true }
311312
}
312313
}
313314
},
314315
{
315316
name: 'gf_get_entry',
316-
description: 'Get an entry by ID. Strips null/empty values and plugin entry meta by default; pass compact=false for full raw data.',
317+
description: 'Get an entry by ID with field labels.',
317318
annotations: { readOnlyHint: true, openWorldHint: true },
318319
inputSchema: {
319320
type: 'object',
320321
properties: {
321322
id: { type: 'number', description: 'Entry ID' },
322-
compact: { type: 'boolean', description: 'Strip null/empty values (default true)', default: true }
323+
compact: { type: 'boolean', description: 'Return raw uncompacted data', default: true }
323324
},
324325
required: ['id']
325326
}
@@ -434,19 +435,19 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
434435
properties: {
435436
addon: { type: 'string', description: 'Addon slug' },
436437
form_id: { type: 'number', description: 'Form ID' },
437-
compact: { type: 'boolean', description: 'Strip null/empty values (default true)', default: true }
438+
compact: { type: 'boolean', description: 'Return raw uncompacted data', default: true }
438439
}
439440
}
440441
},
441442
{
442443
name: 'gf_get_feed',
443-
description: 'Get a feed by ID. Omits null/empty values by default; pass compact=false for raw data.',
444+
description: 'Get a feed by ID.',
444445
annotations: { readOnlyHint: true, openWorldHint: true },
445446
inputSchema: {
446447
type: 'object',
447448
properties: {
448449
id: { type: 'number', description: 'Feed ID' },
449-
compact: { type: 'boolean', description: 'Strip null/empty values (default true)', default: true }
450+
compact: { type: 'boolean', description: 'Return raw uncompacted data', default: true }
450451
},
451452
required: ['id']
452453
}

0 commit comments

Comments
 (0)