Skip to main content
Glama

getTopLevelDeclarations

Extract and filter top-level declarations in PureScript code to retrieve names, types, and full source code. Supports regex-based filtering for precise analysis of functions, data types, or classes.

Instructions

Get detailed information about all main definitions in PureScript code: names, types (function/data/class), and full source code. Includes filtering options to find specific items. More comprehensive than getTopLevelDeclarationNames.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNoPureScript code string.
filePathNoAbsolute path to the PureScript file. Only absolute paths are supported.
filtersNoOptional filters to apply to the declarations.
Behavior3/5

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

With no annotations provided, the description carries the full burden. It describes what information is returned (detailed info including names, types, full source code) and mentions filtering capabilities, but doesn't disclose important behavioral aspects like whether this is a read-only operation, potential performance implications, error conditions, or response format. The description adds some value but leaves significant gaps.

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 appropriately concise with two sentences that each serve distinct purposes: the first states the core functionality, the second adds comparative context. No wasted words, though it could be slightly more front-loaded by mentioning filtering earlier.

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

Completeness3/5

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

For a tool with 3 parameters, no annotations, and no output schema, the description provides adequate but incomplete context. It covers the purpose and distinguishes from one sibling, but doesn't address the response format, error handling, or performance characteristics that would be helpful given the lack of structured metadata.

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 description coverage is 100%, so the schema already documents all parameters thoroughly. The description mentions 'filtering options' but doesn't add meaningful semantic context beyond what's in the schema. It doesn't explain when to use filePath vs code, or provide examples of filter usage. Baseline 3 is appropriate when the schema does the heavy lifting.

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 the tool's purpose: 'Get detailed information about all main definitions in PureScript code' with specific details about what information is returned (names, types, full source code). It explicitly distinguishes from sibling tool 'getTopLevelDeclarationNames' by stating it's 'more comprehensive'.

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 provides excellent usage guidance by explicitly comparing to the sibling tool 'getTopLevelDeclarationNames' and stating this tool is 'more comprehensive.' This tells the agent when to choose this tool over that specific alternative, though it doesn't mention other siblings.

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

Related 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/avi892nash/purescript-mcp-tools'

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