vybsly_ask
Ask a question and receive a synthesized answer with cited source URLs for verification.
Instructions
Ask a question, get a sourced AI answer (like Perplexity). Returns a synthesized answer plus the source URLs used.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| question | Yes | The question to answer | |
| max_sources | No | How many sources to cite (default 5) |
Implementation Reference
- index.js:82-92 (schema)Tool schema definition for 'vybsly_ask' — declares the tool name, description ('Perplexity-style sourced AI answer'), inputSchema requiring 'question' (string) with optional 'max_sources' (number, default 5).
name: 'vybsly_ask', description: 'Ask a question, get a sourced AI answer (like Perplexity). Returns a synthesized answer plus the source URLs used.', inputSchema: { type: 'object', properties: { question: { type: 'string', description: 'The question to answer' }, max_sources: { type: 'number', description: 'How many sources to cite (default 5)', default: 5 } }, required: ['question'] } }, - index.js:34-35 (registration)The TOOLS array (line 34) that contains all tool definitions including 'vybsly_ask', registered on the server via ListToolsRequestSchema handler at line 417.
const TOOLS = [ { - index.js:458-466 (handler)Handler logic for 'vybsly_ask' — sends a POST request to `${VYBSLY_BASE}/ask` with JSON body containing 'question' and 'max_sources', then parses the JSON response. Unlike other tools (which use the shared vybslyCall helper), this one uses fetch directly for a POST request.
case 'vybsly_ask': { const res = await fetch(`${VYBSLY_BASE}/ask`, { method: 'POST', headers: { 'Content-Type': 'application/json', ...(API_KEY && { 'X-API-Key': API_KEY }) }, body: JSON.stringify({ question: args.question, max_sources: args.max_sources || 5 }) }); result = await res.json(); break; } - index.js:417-417 (registration)The ListToolsRequestSchema handler that registers all TOOLS (including vybsly_ask) with the MCP server.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS })); - index.js:21-32 (helper)The vybslyCall helper function used by most tools; notably, 'vybsly_ask' does NOT use this helper (it uses raw fetch for POST), but this is the generic API helper for reference.
async function vybslyCall(path, params = {}) { const qs = new URLSearchParams(params).toString(); const url = `${VYBSLY_BASE}${path}${qs ? '?' + qs : ''}`; const headers = { 'Accept': 'application/json' }; if (API_KEY) headers['X-API-Key'] = API_KEY; const res = await fetch(url, { headers }); if (!res.ok) { const text = await res.text(); throw new Error(`Vybsly API ${res.status}: ${text.slice(0, 300)}`); } return res.json(); }