Skip to main content
Glama

Get runnable R, Python, or Julia code

get_code
Read-onlyIdempotent

Retrieve runnable R, Python, or Julia code for a named statistical, econometric, causal inference, or ML task. Filter by language or source to get code blocks with packages, links, citations.

Instructions

Get runnable code from the library for a specific statistical, econometric, causal inference, or machine learning task, in R, Python, or Julia. Suited to requests for code that carries out a named estimator, test, or modeling step; it returns code with brief context, not an explanation of the method. Results can be restricted to one language or one work. Returns code blocks with the section they come from, the packages they use, a link, and a citation.

Input Schema

NameRequiredDescriptionDefault
limitNoNumber of sections to return code from (default 4).
topicYesThe task, e.g. "Callaway and Sant'Anna group-time ATT", "rdrobust bandwidth", "WoE binning scorecard".
sourceNoLimit to one work: data_analysis (A Guide on Data Analysis); causalverse (causalverse: The All-in-One Causal Inference Toolkit); credit_score (Credit Scoring: Theory, Methods, and Practice); marketing_research (Marketing Research: A Technical and Academic Treatment); ai_in_action (AI in Action: A Reference for Artificial Intelligence); advanced_data_analysis (Advanced Data Analysis); tidy_finance_vn (Applying Tidy Finance with Python to Vietnam); tidy_finance_vn_vi (Tài Chính Ứng Dụng với Python); mlpy (Machine Learning in Python); publications (Research Articles and Publications).
languageNoProgramming language of the code: r, python, or julia.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.1
    • changedInput schema / properties / source / description
      Previous value: -"Limit to one work: data_analysis (A Guide on Data Analysis); causalverse (causalverse: The All-in-One Causal Inference Toolkit); credit_score (Credit Scoring: Theory, Methods, and Practice); marketing_research (Marketing Research: A Technical and Academic Treatment); ai_in_action (AI in Action: A Reference for Artificial Intelligence)."New value: +"Limit to one work: data_analysis (A Guide on Data Analysis); causalverse (causalverse: The All-in-One Causal Inference Toolkit); credit_score (Credit Scoring: Theory, Methods, and Practice); marketing_research (Marketing Research: A Technical and Academic Treatment); ai_in_action (AI in Action: A Reference for Artificial Intelligence); advanced_data_analysis (Advanced Data Analysis); tidy_finance_vn (Applying Tidy Finance with Python to Vietnam); tidy_finance_vn_vi (Tài Chính Ứng Dụng với Python); mlpy (Machine Learning in Python); publications (Research Articles and Publications)."
    • changedInput schema / properties / source / enum
      Previous value: -[
      -  "data_analysis",
      -  "causalverse",
      -  "credit_score",
      -  "marketing_research",
      -  "ai_in_action"
      -]New value: +[
      +  "data_analysis",
      +  "causalverse",
      +  "credit_score",
      +  "marketing_research",
      +  "ai_in_action",
      +  "advanced_data_analysis",
      +  "tidy_finance_vn",
      +  "tidy_finance_vn_vi",
      +  "mlpy",
      +  "publications"
      +]
  2. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false, and openWorldHint=false, so the safety profile is covered. The description adds genuinely useful behavior beyond that: results can be restricted to one language or one work, and the return payload includes the originating section, packages, a link, and a citation — valuable since no output schema exists.

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?

Three dense sentences, front-loaded with the core action and scope, then the usage boundary, then the return shape. No filler, though the middle clause is slightly run-on and could be tightened.

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?

With no output schema, the description correctly compensates by describing the return payload (code blocks plus section, packages, link, citation) and the restriction options. Together with the 100%-covered schema and clarifying annotations, an agent has everything needed to call it correctly.

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%, including detailed enum labels for every source work, so the schema already carries the parameter meaning. The description only restates the language/work restriction at a high level and adds no syntax or format detail beyond the schema; baseline 3 applies.

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?

States a specific verb+resource ('Get runnable code from the library') with an explicit scope (statistical, econometric, causal inference, or ML tasks) and language range. It also draws the boundary against an explanation-style sibling by saying it 'returns code with brief context, not an explanation of the method,' which lets an agent separate it from choose_method.

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?

Gives a clear positive trigger: 'Suited to requests for code that carries out a named estimator, test, or modeling step.' It also states a negative condition (not an explanation of the method), but never names the alternative tool (e.g., choose_method) or when to prefer it, stopping short of a full when/when-not/alternatives statement.

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

Deploy Server

Other Tools