fix: shorten MCP server name to prevent tool name length errors (#360)
* fix: shorten MCP server name to prevent tool name length errors (#358) Root cause: Claude Code prefixes MCP tool names with `mcp__plugin_{plugin-name}_{server-name}__` which was 43 chars for `mcp__plugin_claude-mem_claude-mem-search__`. Combined with `progressive_description` (22 chars) this exceeded the 64 char limit. Changes: - Shortened MCP server name from 'claude-mem-search' to 'mem-search' (saves 8 chars, new prefix is 35 chars) - Renamed `progressive_description` tool to `help` (saves 18 chars) - Updated SKILL.md to reference new `help` tool name - Updated internal Server constructor name for consistency All tool names now safely under 64 char limit: - Longest is now `get_batch_observations` at 56 chars total - `help` is only 39 chars total Fixes #358 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * refactor: rename get_batch_observations to get_observations The plural form naturally implies multiple items can be fetched, following WordPress conventions. Simpler and clearer naming. Also saves 6 additional characters for MCP tool name length. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * docs: update all references to renamed MCP tools Updated documentation and code comments to reflect: - progressive_description → help - get_batch_observations → get_observations Files updated: - docs/public/usage/claude-desktop.mdx - docs/public/architecture/worker-service.mdx - src/services/worker/FormattingService.ts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -240,7 +240,7 @@ POST /api/observations/batch
|
|||||||
- `400 Bad Request`: `{"error": "ids must be an array of numbers"}`
|
- `400 Bad Request`: `{"error": "ids must be an array of numbers"}`
|
||||||
- `400 Bad Request`: `{"error": "All ids must be integers"}`
|
- `400 Bad Request`: `{"error": "All ids must be integers"}`
|
||||||
|
|
||||||
**Use Case**: This endpoint is used by the `get_batch_observations` MCP tool to efficiently retrieve multiple observations in a single request, avoiding the overhead of multiple individual requests.
|
**Use Case**: This endpoint is used by the `get_observations` MCP tool to efficiently retrieve multiple observations in a single request, avoiding the overhead of multiple individual requests.
|
||||||
|
|
||||||
#### 9. Get Session by ID
|
#### 9. Get Session by ID
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -118,12 +118,12 @@ The skill provides access to these MCP tools:
|
|||||||
| `search` | Unified search across observations, sessions, and prompts |
|
| `search` | Unified search across observations, sessions, and prompts |
|
||||||
| `timeline` | Get chronological context around a query or observation ID |
|
| `timeline` | Get chronological context around a query or observation ID |
|
||||||
| `get_observation` | Fetch a single observation by ID |
|
| `get_observation` | Fetch a single observation by ID |
|
||||||
| `get_batch_observations` | Fetch multiple observations efficiently |
|
| `get_observations` | Fetch multiple observations efficiently |
|
||||||
| `get_session` | Fetch session summary by ID |
|
| `get_session` | Fetch session summary by ID |
|
||||||
| `get_prompt` | Fetch user prompt by ID |
|
| `get_prompt` | Fetch user prompt by ID |
|
||||||
| `get_recent_context` | Get recent timeline items |
|
| `get_recent_context` | Get recent timeline items |
|
||||||
| `get_context_timeline` | Get timeline around a specific observation |
|
| `get_context_timeline` | Get timeline around a specific observation |
|
||||||
| `progressive_description` | Load detailed usage instructions |
|
| `help` | Load detailed usage instructions |
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"mcpServers": {
|
"mcpServers": {
|
||||||
"claude-mem-search": {
|
"mem-search": {
|
||||||
"type": "stdio",
|
"type": "stdio",
|
||||||
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/mcp-server.cjs"
|
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/mcp-server.cjs"
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1157,7 +1157,7 @@ No previous sessions found for project "${r}".`}]};let i=[];i.push("# Recent Ses
|
|||||||
\u{1F4A1} Search Strategy:
|
\u{1F4A1} Search Strategy:
|
||||||
1. Search with index to see titles, dates, IDs
|
1. Search with index to see titles, dates, IDs
|
||||||
2. Use timeline to get context around interesting results
|
2. Use timeline to get context around interesting results
|
||||||
3. Batch fetch full details: get_batch_observations(ids=[...])
|
3. Batch fetch full details: get_observations(ids=[...])
|
||||||
|
|
||||||
Tips:
|
Tips:
|
||||||
\u2022 Filter by type: obs_type="bugfix,feature"
|
\u2022 Filter by type: obs_type="bugfix,feature"
|
||||||
|
|||||||
Binary file not shown.
@@ -86,13 +86,13 @@ For each relevant ID, fetch full details using MCP tools:
|
|||||||
**Fetch multiple observations (ALWAYS use for 2+ IDs):**
|
**Fetch multiple observations (ALWAYS use for 2+ IDs):**
|
||||||
|
|
||||||
```
|
```
|
||||||
get_batch_observations(ids=[11131, 10942, 10855])
|
get_observations(ids=[11131, 10942, 10855])
|
||||||
```
|
```
|
||||||
|
|
||||||
**With ordering and limit:**
|
**With ordering and limit:**
|
||||||
|
|
||||||
```
|
```
|
||||||
get_batch_observations(
|
get_observations(
|
||||||
ids=[11131, 10942, 10855],
|
ids=[11131, 10942, 10855],
|
||||||
orderBy="date_desc",
|
orderBy="date_desc",
|
||||||
limit=10,
|
limit=10,
|
||||||
@@ -126,7 +126,7 @@ get_prompt(id=5421)
|
|||||||
|
|
||||||
**Batch optimization:**
|
**Batch optimization:**
|
||||||
|
|
||||||
- **ALWAYS use `get_batch_observations` for 2+ observations**
|
- **ALWAYS use `get_observations` for 2+ observations**
|
||||||
- 10-100x more efficient than individual fetches
|
- 10-100x more efficient than individual fetches
|
||||||
- Single HTTP request vs N requests
|
- Single HTTP request vs N requests
|
||||||
- Returns all results in one response
|
- Returns all results in one response
|
||||||
@@ -175,13 +175,13 @@ search(query="database migration", limit=20, project="my-project")
|
|||||||
|
|
||||||
**Get detailed instructions:**
|
**Get detailed instructions:**
|
||||||
|
|
||||||
Use the `progressive_description` tool to load full instructions on-demand:
|
Use the `help` tool to load full instructions on-demand:
|
||||||
|
|
||||||
```
|
```
|
||||||
progressive_description(topic="workflow") # Get 4-step workflow
|
help(topic="workflow") # Get 4-step workflow
|
||||||
progressive_description(topic="search_params") # Get parameters reference
|
help(topic="search_params") # Get parameters reference
|
||||||
progressive_description(topic="examples") # Get usage examples
|
help(topic="examples") # Get usage examples
|
||||||
progressive_description(topic="all") # Get complete guide
|
help(topic="all") # Get complete guide
|
||||||
```
|
```
|
||||||
|
|
||||||
## Why This Workflow?
|
## Why This Workflow?
|
||||||
@@ -210,5 +210,5 @@ progressive_description(topic="all") # Get complete guide
|
|||||||
**Remember:**
|
**Remember:**
|
||||||
|
|
||||||
- ALWAYS get timeline context to understand what was happening
|
- ALWAYS get timeline context to understand what was happening
|
||||||
- ALWAYS use `get_batch_observations` when fetching 2+ observations
|
- ALWAYS use `get_observations` when fetching 2+ observations
|
||||||
- The workflow is optimized: search → timeline → batch fetch = 10-100x faster
|
- The workflow is optimized: search → timeline → batch fetch = 10-100x faster
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ const TOOL_ENDPOINT_MAP: Record<string, string> = {
|
|||||||
'timeline': '/api/timeline',
|
'timeline': '/api/timeline',
|
||||||
'get_recent_context': '/api/context/recent',
|
'get_recent_context': '/api/context/recent',
|
||||||
'get_context_timeline': '/api/context/timeline',
|
'get_context_timeline': '/api/context/timeline',
|
||||||
'progressive_description': '/api/instructions'
|
'help': '/api/instructions'
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -259,13 +259,13 @@ const tools = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'progressive_description',
|
name: 'help',
|
||||||
description: 'Usage help',
|
description: 'Usage help',
|
||||||
inputSchema: z.object({
|
inputSchema: z.object({
|
||||||
topic: z.enum(['workflow', 'search_params', 'examples', 'all']).default('all')
|
topic: z.enum(['workflow', 'search_params', 'examples', 'all']).default('all')
|
||||||
}),
|
}),
|
||||||
handler: async (args: any) => {
|
handler: async (args: any) => {
|
||||||
const endpoint = TOOL_ENDPOINT_MAP['progressive_description'];
|
const endpoint = TOOL_ENDPOINT_MAP['help'];
|
||||||
return await callWorkerAPI(endpoint, args);
|
return await callWorkerAPI(endpoint, args);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -280,7 +280,7 @@ const tools = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'get_batch_observations',
|
name: 'get_observations',
|
||||||
description: 'Batch fetch',
|
description: 'Batch fetch',
|
||||||
inputSchema: z.object({
|
inputSchema: z.object({
|
||||||
ids: z.array(z.number()),
|
ids: z.array(z.number()),
|
||||||
@@ -317,7 +317,7 @@ const tools = [
|
|||||||
// Create the MCP server
|
// Create the MCP server
|
||||||
const server = new Server(
|
const server = new Server(
|
||||||
{
|
{
|
||||||
name: 'claude-mem-search-server',
|
name: 'mem-search-server',
|
||||||
version: '1.0.0',
|
version: '1.0.0',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export class FormattingService {
|
|||||||
💡 Search Strategy:
|
💡 Search Strategy:
|
||||||
1. Search with index to see titles, dates, IDs
|
1. Search with index to see titles, dates, IDs
|
||||||
2. Use timeline to get context around interesting results
|
2. Use timeline to get context around interesting results
|
||||||
3. Batch fetch full details: get_batch_observations(ids=[...])
|
3. Batch fetch full details: get_observations(ids=[...])
|
||||||
|
|
||||||
Tips:
|
Tips:
|
||||||
• Filter by type: obs_type="bugfix,feature"
|
• Filter by type: obs_type="bugfix,feature"
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ Settings and configuration (use domain services directly):
|
|||||||
- Keep all existing behavior identical
|
- Keep all existing behavior identical
|
||||||
|
|
||||||
**MCP vs Direct DB Split** (inherited, not changed in Phase 1):
|
**MCP vs Direct DB Split** (inherited, not changed in Phase 1):
|
||||||
- Search operations → MCP server (claude-mem-search)
|
- Search operations → MCP server (mem-search)
|
||||||
- Session/data operations → Direct DB access via domain services
|
- Session/data operations → Direct DB access via domain services
|
||||||
|
|
||||||
## Future Phase 2
|
## Future Phase 2
|
||||||
|
|||||||
Reference in New Issue
Block a user