search_jobs
Search job listings using query and optional filters including tech stack, compensation, and remote preference.
Instructions
Search for job listings matching a query and optional filters.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Job search query (e.g. 'Senior Backend Engineer') | |
| stack | No | Tech stack filter (e.g. 'Node.js, TypeScript') | |
| comp_min | No | Minimum compensation in USD | |
| comp_max | No | Maximum compensation in USD | |
| remote | No | Filter for remote-only jobs | |
| limit | No | Max results to return (default: 10) |
Implementation Reference
- index.js:59-93 (schema)Schema definition for the search_jobs tool, including input properties (query, stack, comp_min, comp_max, remote, limit) and type/description metadata.
const WEEK1_TOOLS = [ { name: 'search_jobs', description: 'Search for jobs across integrated job boards. Returns ranked listings matching the query and optional filters.', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Job title, keywords, or natural-language search (e.g. "senior backend engineer fintech")', }, stack: { type: 'string', description: 'Comma-separated tech stack filter (e.g. "Node.js,TypeScript,PostgreSQL")', }, comp_min: { type: 'number', description: 'Minimum annual compensation in USD', }, comp_max: { type: 'number', description: 'Maximum annual compensation in USD', }, remote: { type: 'boolean', description: 'If true, return only remote-friendly roles', }, limit: { type: 'number', description: 'Max results to return (default: 20, max: 100)', }, }, required: ['query'], }, }, - index.js:239-242 (registration)Registration of search_jobs as a locally-defined new tool via WEEK1_TOOLS array, included in the NEW_TOOL_NAMES set for merging with backend tools.
const NEW_TOOL_NAMES = new Set([ ...WEEK1_TOOLS.map(t => t.name), ...WEEK2_TOOLS.map(t => t.name), ]); - index.js:275-305 (handler)The tools/call handler (handleToolsCall) that proxies the search_jobs invocation to the backend API via callBackend. If the backend is unreachable, it returns a stub 'not_implemented' response.
async function handleToolsCall(id, params) { const toolName = params && params.name; try { const result = await callBackend({ jsonrpc: '2.0', id, method: 'tools/call', params }); send({ ...result, id }); } catch (err) { // If the backend is unreachable and this is a new tool, return a clear stub message if (NEW_TOOL_NAMES.has(toolName)) { send({ jsonrpc: '2.0', id, result: { content: [ { type: 'text', text: JSON.stringify({ status: 'not_implemented', tool: toolName, message: `The '${toolName}' tool is defined in the MCP layer but the backend handler is not yet deployed. Backend error: ${err.message}`, }, null, 2), }, ], isError: false, }, }); } else { send({ jsonrpc: '2.0', id, error: { code: -32000, message: err.message } }); } } } - index.js:19-52 (helper)The callBackend helper function that makes HTTP POST requests to the backend MCP endpoint with Bearer token auth.
function callBackend(body) { return new Promise((resolve, reject) => { const payload = JSON.stringify(body); const isHttps = parsedBase.protocol === 'https:'; const lib = isHttps ? https : require('http'); const options = { hostname: parsedBase.hostname, port: parsedBase.port || (isHttps ? 443 : 80), path: MCP_PATH, method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${API_KEY}`, 'Content-Length': Buffer.byteLength(payload), }, }; const req = lib.request(options, (res) => { let data = ''; res.on('data', chunk => data += chunk); res.on('end', () => { try { resolve(JSON.parse(data)); } catch (e) { reject(new Error(`Invalid JSON from backend: ${data.slice(0, 200)}`)); } }); }); req.on('error', reject); req.write(payload); req.end(); }); }