We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/yoniassia/quantclaw-data'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
import { NextRequest, NextResponse } from 'next/server';
export const dynamic = 'force-dynamic';
export async function GET(request: NextRequest) {
const { searchParams } = new URL(request.url);
const ticker = searchParams.get('ticker') || searchParams.get('symbol') || 'SPY';
const action = searchParams.get('action') || 'get_earnings_history';
try {
const { execSync } = await import('child_process');
const cmd = `cd /home/quant/apps/quantclaw-data && python3 -c "import modules.earnings_surprise_history as m; import json; print(json.dumps(m.${action}('${ticker}')))"`;
const result = execSync(cmd, { timeout: 60000 }).toString().trim();
const lines = result.split('\n');
const jsonLine = lines[lines.length - 1];
return NextResponse.json(JSON.parse(jsonLine));
} catch (e: any) {
return NextResponse.json({ error: e.message?.slice(0, 500) }, { status: 500 });
}
}