This project uses Azure OpenAI embeddings to find the most relevant tools for given prompts.
The application:
- Loads tool definitions from
list-tools.json - Loads test prompts from
prompts.json - Creates embeddings for tool descriptions using Azure OpenAI
- Tests prompt-to-tool matching using vector similarity search
main.go- Main application logic and embedding generationprompts.go- JSON loading functionality for test promptsprompts.json- Test prompts organized by expected tool (easily editable)list-tools.json- Tool definitions and schemasvectordb.go- Vector database implementationmcp/messages.go- MCP protocol message structures
This application requires two environment variables to be configured:
TEXT_EMBEDDING_API_KEY- Your Azure OpenAI API keyAOAI_ENDPOINT- Your Azure OpenAI endpoint URL (including deployment and API version)
Set both required environment variables:
export TEXT_EMBEDDING_API_KEY="your_api_key_here"
export AOAI_ENDPOINT="https://your-resource.openai.azure.com/openai/deployments/text-embedding-3-large/embeddings?api-version=2023-05-15"- Copy the example environment file:
cp .env.example .env
- Edit
.envand add both required variables:TEXT_EMBEDDING_API_KEY=your_actual_api_key_here AOAI_ENDPOINT=https://your-resource.openai.azure.com/openai/deployments/text-embedding-3-large/embeddings?api-version=2023-05-15
Create a file named api-key.txt in the project root with your API key.
Note: This option only provides the API key. You must still set the AOAI_ENDPOINT environment variable when using this method.
Note: The .env file and api-key.txt are both included in .gitignore to prevent accidentally committing sensitive information.
go run .The application supports different output formats based on your needs:
For normal terminal use or when redirecting to .txt files:
go run .
# or
go run . > results.txtTo generate markdown format, set the output environment variable to md:
output=md go run . > analysis_results.mdPlain Text (.txt or terminal):
- Compact, simple format
- Minimal formatting for easy parsing
- Original terminal-style output
Markdown (.md):
- 📊 Structured layout with headers and navigation
- 📋 Table of Contents with clickable links
- 📈 Results tables with visual indicators (✅/❌)
- 📊 Success rate analysis with performance ratings
- 🕐 Execution timing and statistics
- Visual status indicators: ✅ for expected tools, ❌ for others
- Performance ratings: 🟢 Excellent, 🟡 Good, 🟠 Fair, 🔴 Poor
- Professional tables for easy analysis
- Clickable navigation for large result sets
See MARKDOWN_OUTPUT.md for detailed examples and features.
Contains test prompts organized by expected tool name. The structure is:
{
"tool-name": [
"Test prompt 1",
"Test prompt 2"
]
}This file can be easily edited to:
- Add new test prompts
- Modify existing prompts
- Add prompts for new tools
- Remove outdated prompts
Contains the complete tool definitions including:
- Tool names and descriptions
- Input schemas
- Annotations (permissions, hints, etc.)
- Never commit API keys to version control
- Use environment variables in production
- Use
.envfiles for local development (they're gitignored) - Rotate your API keys regularly
- Use least-privilege access principles