Skip to main content
Glama
deep-research.js1.34 kB
import logger from "../core/logger.js"; import { presearchService } from "../services/presearchService.js"; const DeepResearchInputSchema = { type: "object", properties: { query: { type: "string", description: "The research topic" }, depth: { type: "number", description: "Depth of research (1-3)", default: 2, }, breadth: { type: "number", description: "Number of parallel paths (2-5)", default: 3, }, }, required: ["query"], }; export const deepResearchTool = { name: "presearch_deep_research", description: "Perform a multi-step deep research task on a topic. Generates a comprehensive report by exploring multiple sub-topics.", inputSchema: DeepResearchInputSchema, execute: async (args) => { // 1. Initial broad search const initialResults = await presearchService.search(args.query, { limit: args.breadth || 3, }); const report = { topic: args.query, summary: "Research in progress...", sources: initialResults.results, subTopics: [], }; // 2. Mock recursive depth (real implementation would recurse) // For V1, we return the structured initial findings return { content: [ { type: "text", text: JSON.stringify(report, null, 2), }, ], }; }, };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/NosytLabs/presearch-search-api-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server