Skip to main content
Glama
by mohalmah
test-mcp-content.js•2.02 kB
#!/usr/bin/env node /** * Test script to verify MCP server tools are working with OAuth */ import { discoverTools } from './lib/tools.js'; async function testMCPTools() { console.log('šŸ” Testing MCP Server Tools with OAuth...'); console.log('═'.repeat(60)); try { // Discover all available tools console.log('šŸ“‹ Step 1: Discovering available tools...'); const tools = await discoverTools(); console.log(`āœ… Found ${tools.length} tools`); // Find the get-content tool const getContentTool = tools.find(tool => tool.definition.function.name === 'script_projects_get_content' ); if (!getContentTool) { console.error('āŒ script_projects_get_content tool not found!'); console.log('Available tools:'); tools.forEach(tool => { console.log(` - ${tool.definition.function.name}`); }); return; } console.log('āœ… Found script_projects_get_content tool'); // Test the tool with your script ID console.log('šŸ“‹ Step 2: Testing script content fetch...'); const scriptId = '1fSY7y3Rh84FsgJmrFIMm4AUOV3mPgelLRvZ4Dahrv68zyDzX-cGbeYjn'; console.log(`šŸ” Fetching content for script: ${scriptId}`); const result = await getContentTool.function({ scriptId }); if (result.error) { console.error('āŒ Error fetching content:', result.error); } else { console.log('āœ… Successfully fetched script content!'); console.log('šŸ“Š Content summary:'); console.log(` - Script ID: ${result.scriptId}`); console.log(` - Number of files: ${result.files?.length || 0}`); if (result.files) { result.files.forEach((file, index) => { console.log(` - File ${index + 1}: ${file.name} (${file.type})`); }); } console.log('\nšŸ“„ Full content:'); console.log(JSON.stringify(result, null, 2)); } } catch (error) { console.error('šŸ’„ Test failed:', error); } } testMCPTools();

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/mohalmah/google-appscript-mcp-server'

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