from sqlite_utils import Database
import sys
from gemini_docs_mcp.config import DB_PATH
from gemini_docs_mcp.server import search_documentation
def test_search(query: str):
"""Tests FTS search for a given query."""
print(f"\n--- Testing search for: '{query}' ---")
try:
db = Database(DB_PATH)
if "docs" not in db.table_names():
print("Error: 'docs' table not found. Has ingestion run?")
return
results = search_documentation([query])
if not results:
print("No results found.")
return
print(f"Found {len(results)} results (showing top 5):")
for i, r in enumerate(results, 1):
print(f"\nResult {i}:")
print(f"Title: {r['title']}")
print(f"URL: {r['url']}")
snippet = r['content'][:200].replace('\n', ' ') + "..."
print(f"Snippet: {snippet}")
except Exception as e:
print(f"An error occurred: {e}")
if __name__ == "__main__":
if len(sys.argv) > 1:
for query in sys.argv[1:]:
test_search(query)
else:
# Default test queries if none provided
test_search("function calling with gemini")
# test_search("embeddings")
# test_search("gemini pro")
# test_search("api key")
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/philschmid/gemini-api-docs-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server