search_content
Search manuscript content semantically to find relevant information across your writing project files using natural language queries.
Instructions
Semantic search across all manuscript content
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>"
},
"name": "search_content"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | No | Path to manuscript directory (defaults to current directory) | |
| query | Yes | Search query | |
| scope | No | File scope pattern (e.g., 'chapters/*.md') | |
| limit | No | Maximum results |
Implementation Reference
- src/tools/WriterToolHandlers.ts:107-113 (handler)Handler function that executes the MCP 'search_content' tool logic by parsing input arguments and delegating to WritersAid.searchContent
private async searchContent(args: Record<string, unknown>) { const query = args.query as string; const scope = args.scope as string | undefined; const limit = (args.limit as number) || 10; return this.writersAid.searchContent(query, { scope, limit }); } - MCP tool schema definition for 'search_content' including name, description, and inputSchema validation
{ name: "search_content", description: "Semantic search across all manuscript content", inputSchema: { type: "object", properties: { project_path: { type: "string", description: "Path to manuscript directory (defaults to current directory)" }, query: { type: "string", description: "Search query" }, scope: { type: "string", description: "File scope pattern (e.g., 'chapters/*.md')" }, limit: { type: "number", description: "Maximum results", default: 10 }, }, required: ["query"], }, }, - src/index.ts:73-75 (registration)MCP server registration of tool list handler that provides all tool schemas including 'search_content'
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: writerToolDefinitions, })); - src/index.ts:86-92 (registration)MCP server registration of tool call handler that instantiates WriterToolHandlers and dispatches to specific tool handler for 'search_content'
const writersAid = new WritersAid({ projectPath }); const handlers = new WriterToolHandlers(writersAid); // Call the tool const result = await handlers.handleTool(name, args || {}); // Close the connection after use - src/WritersAid.ts:184-186 (helper)Supporting method in WritersAid class that performs the actual content search by delegating to ManuscriptSearch
async searchContent(query: string, options?: { scope?: string; limit?: number }) { return this.search.search(query, options); }