Skip to main content
Glama

register_code_artifact

Save reusable code artifacts to a code repository with full reproducibility context—dependencies, parameters, and purpose—for future reuse.

Instructions

Save a script, snippet, reusable function or template to the Code Repository.

Use this whenever the user writes or shares code worth reusing, so it can be
found and rebuilt later. Capture as much reproducibility context as you can.

Args:
    title: Short descriptive name (e.g. "INLA BYM2 spatial model setup").
    code: The actual code.
    language: r | python | sql | stata | shell | … (lowercase).
    project_id: The project this belongs to (links it for reuse). Optional.
    kind: script | snippet | function | template.
    purpose: One line on what it does / when to use it.
    tags: Comma-separated tags (e.g. "spatial,INLA,mapping").
    file_path: Where the script lives on disk, if any.
    packages: Dependencies / environment (e.g. "INLA 24.9, sf, dplyr").
    params: Seeds, thresholds, hyperparameters used (for exact reproduction).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYes
codeYes
languageNo
project_idNo
kindNoscript
purposeNo
tagsNo
file_pathNo
packagesNo
paramsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

No annotations are provided, so the description must fully disclose behavior. It states the tool saves to the Code Repository but does not mention whether it overwrites duplicates, requires permissions, or has any side effects. The parameter examples hint at reproducibility but fail to disclose the tool's internal behavior beyond a save operation.

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, starting with the primary purpose in the first sentence, followed by usage guidance, and concluding with a structured parameter list. Every sentence adds value; there is no redundancy. The parameter documentation is necessary given the schema's lack of descriptions.

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 10 parameters, 2 required, and an output schema present, the description provides thorough guidance for input parameters. However, it omits what the tool returns (e.g., success confirmation or artifact ID), though the output schema may cover that. The description could mention the return value to complete the context.

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?

The input schema has 0% description coverage, leaving all 10 parameters undocumented. The description compensates fully with a detailed 'Args:' section, explaining each parameter with examples and intended usage (e.g., 'e.g. "INLA BYM2 spatial model setup"' for title). This adds essential meaning beyond the schema's minimal type and title fields.

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 'Save a script, snippet, reusable function or template to the Code Repository', specifying the verb (Save) and resource (Code Repository). It lists distinct code artifact types, differentiating it from sibling tools like add_glossary_term or search_code_repository. The phrase 'so it can be found and rebuilt later' reinforces its purpose.

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 explicitly says 'Use this whenever the user writes or shares code worth reusing', providing clear when-to-use guidance. It implicitly excludes non-reusable code but does not mention alternatives like search_code_repository for retrieval. The directive 'Capture as much reproducibility context as you can' adds operational context.

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/SVerITG/Metis'

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