Skip to main content
Glama
call518

MCP PostgreSQL Operations

by call518

get_user_functions_stats

Analyze PostgreSQL user-defined function performance statistics, including execution counts, average timing, and bottlenecks to identify slow or frequently called functions.

Instructions

[Tool Purpose]: Analyze performance statistics for user-defined functions

[Exact Functionality]:

  • Show execution count and timing statistics for user functions

  • Calculate average execution time per function call

  • Identify performance bottlenecks in user-defined functions

  • Provide total and self execution time breakdown

[Required Use Cases]:

  • When user requests "function stats", "function performance", etc.

  • When analyzing user-defined function performance

  • When identifying slow or frequently called functions

  • When optimizing application function usage

[Strictly Prohibited Use Cases]:

  • Requests for function modification or optimization

  • Requests for statistics reset

  • Requests for function execution or testing

Input Schema

NameRequiredDescriptionDefault
database_nameNoDatabase name to analyze (uses default database if omitted)

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv3.4.3
    • addedInput schema / properties / database_name / description
      Added value: +"Database name to analyze (uses default database if omitted)"
  2. Changed6 schema fields changedv3.4.2
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / database_name / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / properties / database_name / title
      Removed value: -"Database Name"
    • removedInput schema / properties / database_name / type
      Removed value: -"string"
    • removedOutput schema / properties / result / title
      Removed value: -"Result"
    • removedOutput schema / title
      Removed value: -"_WrappedResult"
  3. Addedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden and makes clear this is a read-only statistics tool by listing prohibited actions like modification, reset, and execution. It explains what statistics are produced, though it does not explicitly state permission requirements or side-effect-free behavior beyond the prohibited-use section.

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

Conciseness4/5

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

The description is front-loaded with purpose and organized into helpful sections, with each section contributing to correct tool selection. It is somewhat verbose due to multiple headings and bullet lists, but there is little wasted content.

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 one optional parameter, full schema description coverage, and an available output schema, the description provides enough context about purpose, expected use, and exclusions for an agent to call the tool correctly. Return-value details are appropriately left to the output schema.

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

Parameters3/5

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

Schema coverage is 100%, and the single optional parameter database_name is fully described in the schema. The description does not add parameter-specific semantics beyond what the schema already provides, so baseline 3 is appropriate.

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 states a specific verb and resource: analyzing performance statistics for user-defined functions. It distinguishes the scope from sibling database/table/query statistics tools by focusing explicitly on user-defined functions.

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

Usage Guidelines5/5

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

The description gives explicit required use cases such as requests for "function stats" or "function performance" and identifying slow or frequently called functions. It also lists strictly prohibited use cases, including modification, reset, and execution/testing, which clearly routes the agent.

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