Skip to main content
Glama
test-search-correct.ps11.43 kB
# Test Correct Search Structure . "$PSScriptRoot\scripts\tests\Load-DotEnv.ps1" Load-DotEnv -EnvFile "$PSScriptRoot\.env" $Headers = @{ "sc_apikey" = $env:SITECORE_API_KEY "Content-Type" = "application/json" } Write-Host "[INFO] Testing CORRECT search structure..." -ForegroundColor Cyan Write-Host "" # Endpoint fallback: prefer SITECORE_ENDPOINT, else build from SITECORE_HOST $endpoint = $env:SITECORE_ENDPOINT if (-not $endpoint -and $env:SITECORE_HOST) { $endpoint = "$(($env:SITECORE_HOST))/sitecore/api/graph/items/master" } # Correct structure based on error hints $queryCorrect = @' { search(keyword: "Home", first: 5) { results { items { id name path } } } } '@ Write-Host "Test: Search with items (plural)" -ForegroundColor Yellow try { $body = @{ query = $queryCorrect } | ConvertTo-Json $response = Invoke-RestMethod -Uri $endpoint -Method Post -Headers $Headers -Body $body Write-Host "[OK] SUCCESS!" -ForegroundColor Green $response.data | ConvertTo-Json -Depth 10 Write-Host "" Write-Host "CORRECT SCHEMA:" -ForegroundColor Green Write-Host "search { results { items { id name path } } }" -ForegroundColor Yellow Write-Host "" Write-Host "Access pattern: result.search.results.items (NOT .item!)" -ForegroundColor Cyan } catch { Write-Host "[FAIL] $($_.Exception.Message)" -ForegroundColor Red } Write-Host ""

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/GaryWenneker/SitecoreMCP'

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