Skip to main content
Glama

Agricultural AI MCP Server

by BishalJena
test-tool.jsโ€ข1.25 kB
// Quick test script to verify the MCP tool works // Run with: node test-tool.js import { spawn } from 'child_process'; const testMCPTool = () => { console.log('๐Ÿงช Testing crop-price MCP tool...'); // Sample MCP request const mcpRequest = { jsonrpc: "2.0", id: 1, method: "tools/call", params: { name: "crop-price", arguments: { state: "Punjab", commodity: "Wheat", limit: 5 } } }; const server = spawn('node', ['dist/server.js'], { stdio: ['pipe', 'pipe', 'pipe'] }); server.stdin.write(JSON.stringify(mcpRequest) + '\n'); server.stdin.end(); server.stdout.on('data', (data) => { console.log('๐Ÿ“Š Server response:', data.toString()); }); server.stderr.on('data', (data) => { console.error('โŒ Server error:', data.toString()); }); server.on('close', (code) => { console.log(`โœ… Test completed with exit code ${code}`); }); }; // Check if built import { existsSync } from 'fs'; if (!existsSync('./dist/server.js')) { console.log('โš ๏ธ Please run "npm run build" first'); process.exit(1); } testMCPTool();

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/BishalJena/fs-gate'

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