Skip to main content
Glama

query

Run read-only SQL queries against a personal health database to cross-reference workout, nutrition, and body measurement data.

Instructions

Read-only SQL against the health database. Must be a single SELECT or WITH statement.

Schema: products(id, name, brand, source, kcal_100g, protein_100g, carbs_100g, fat_100g, fibre_100g, sugar_100g, sat_fat_100g, salt_100g, note, created_at) food_log(id, logged_at, date, product_id, name, source, grams, entered_as, kcal, protein, carbs, fat, note) workouts(id, title, start_time, end_time, date, updated_at, raw) exercise_templates(id, title, primary_muscle_group, secondary_muscle_groups, equipment) workout_exercises(id, workout_id, idx, exercise_template_id, title) workout_sets(id, workout_exercise_id, idx, type, weight_kg, reps, rpe, duration_s, distance_m) body_measurements(date, weight_kg, fat_percent) sync_state(source, cursor, last_run_at, last_status, last_error)

date columns are always the 04:00 Europe/Amsterdam day, computed at write time — group by date, not by a calendar date derived from a timestamp.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Despite no annotations, the description discloses key behavioral aspects: it is read-only, only accepts a single SELECT/WITH statement, and uses Europe/Amsterdam day boundaries for date columns. This goes beyond the basic tool name and input schema by explaining the date convention and statement restriction. It does not mention potential limits or auth, but for a query tool the provided constraints are substantial.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with purpose and constraints, followed by a compact but complete schema listing. All listed tables and columns are necessary for constructing valid SQL. The date note is a single, useful addition without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity, the description covers purpose, statement type, schema, and date semantics comprehensively. The presence of an output schema means return-value details need not be duplicated in the description. The inclusion of the date column convention handles a common edge case that would otherwise cause incorrect aggregations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema coverage, the description compensates by listing the full database schema, including all tables and columns, and explicitly stating the sql parameter must be a single SELECT/WITH statement. It also provides the date grouping convention to help construct correct queries. This adds significant meaning beyond the input schema's bare string type.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with 'Read-only SQL against the health database', which clearly identifies the verb (read/query) and resource (health database). This differentiates it from sibling mutation tools like delete_food_entry or add_product. The constraint of being a single SELECT/WITH statement further clarifies its scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description states the tool is read-only and requires a single SELECT or WITH statement, giving clear context for when it applies. It does not explicitly mention alternative tools or when not to use it, but the read-only scope implicitly excludes write operations, making it appropriate for data retrieval. The date grouping note adds practical guidance for constructing queries.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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/danielv27/health-mcp'

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