Skip to main content
Glama

query

Execute read-only SQL queries against MacroFactor data including nutrition, workouts, body metrics, and Garmin stats to extract specific insights.

Instructions

Run a custom SQL query against the MacroFactor database.

Available tables:
  - daily: date, calories, macros, targets, weight, expenditure, steps, micros
  - food_log: date, time, food details (from Quick Export)
  - workouts: date, exercise, sets, reps, weight (from Quick Export)
  - muscle_sets: date, muscle_group, sets
  - muscle_volume: date, muscle_group, volume_kg
  - exercise_tracking: date, exercise, metric, value (from All-Time)
  - body_metrics: date, metric, value
  - custom_foods: food_name, nutrition info
  - nutrition_targets: program_date, weekday, targets
  - food_log_notes: date, name, note
  - garmin_daily_stats: date, steps, calories, HR, stress, body battery
  - garmin_activities: activity_id, date, type, duration, distance, HR, power
  - garmin_sleep: date, sleep phases, score, HRV, SpO2
  - garmin_training_status: date, status, VO2max, training load, FTP
  - garmin_body_fat: date, body_fat_pct
  - garmin_sync_log: sync history

Use `data_status` to see what's loaded.

Args:
    sql: SQL query (read-only SELECT statements only).

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?

With no annotations, the description carries the full burden. It explicitly states 'read-only SELECT statements only' and enumerates all accessible tables. This adds important behavioral context beyond the schema. Missing details like performance limits or query timeout prevent a 5.

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 concise and well-structured: a clear opening sentence, a bulleted list of tables, and a brief usage tip. Every element earns its place with no redundant language.

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

Completeness4/5

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

Given the tool's complexity (generic SQL query), the description covers purpose, parameter semantics, and available data sources. It does not include example queries, but the output schema exists separately. Without annotations, it is fairly complete but could add a note on return format.

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?

Schema description coverage is 0%, and the description fully compensates by explaining the 'sql' parameter as 'SQL query (read-only SELECT statements only).' This adds critical meaning (purpose and constraint) beyond the schema's type-only definition.

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 clearly states 'Run a custom SQL query against the MacroFactor database,' providing a specific verb (run) and resource (database). It lists available tables, distinguishing this generic query tool from sibling tools that perform specific analyses.

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 provides clear context for usage by listing available tables and advising to 'Use data_status to see what's loaded.' However, it does not explicitly state when not to use this tool in favor of sibling tools, which would earn a 5.

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/NasserAlbusaidi/macrofactor-mcp'

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