Skip to main content
Glama

get_example

Retrieve example code for a Dart/Flutter package from pub.dev, optionally for a specific version, to see how the package is used.

Instructions

Get the example code of a package

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>"
    },
    "name": "get_example"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesPackage name
versionNoSpecific version (optional, defaults to latest)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.3

TDQS

C2.6/5.0
Behavior2/5

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

No annotations are provided, so the description bears the full burden, and it discloses nothing behavioral: not what an "example" returns (raw file contents, a listing of paths, multiple examples), not whether it errors or returns empty when a package ships none, and not how the latest-version default affects results. A single generic sentence is thin for a fetch tool with zero annotation coverage.

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?

One short, front-loaded sentence with no filler or redundancy. The terseness is efficient, though it leaves no room for the disambiguation the tool needs.

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

Completeness2/5

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

For a tool with no annotations and no output schema, the description omits the return shape entirely, which is the key unknown an agent needs to use the result correctly. Combined with the ambiguity of "example code," the definition is under-specified relative to the tool's role.

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% — both 'name' and 'version' (with its latest default) are already documented in the schema, so baseline 3 applies. The description adds nothing beyond the schema, only hinting that the target is a package.

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

Purpose3/5

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

"Get the example code of a package" gives a verb and a resource, but "example code" is ambiguous — it could mean example/sample directories shipped in the package, usage snippets, or a code block from documentation. It also does no work to distinguish itself from siblings such as get_readme, which often contain the same examples.

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

Usage Guidelines2/5

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

There is no statement of when to call this versus get_readme, get_changelog, or get_package_info, all of which plausibly surface example content. The only implicit guidance is the required package name in the schema.

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