Skip to main content
Glama
AgentBase1
by AgentBase1

get_instruction

Retrieve complete instruction files from the OpenClaw registry to access agent prompts, skills, workflows, and domain packs for deployment.

Instructions

Fetch a complete instruction file from the OpenClaw registry by slug. Returns the full Markdown file including YAML frontmatter, purpose, usage notes, and the deployable instruction text. The instruction is in the "## The Instruction" section.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slugYesThe slug of the instruction file (e.g. "tier1-customer-support", "structured-web-research"). Get slugs from search_registry.
instruction_onlyNoIf true, return only the deployable instruction text (extracted from the fenced code block). If false, return the full Markdown file. Default: false.

Implementation Reference

  • The handleGetInstruction function implements the tool logic - fetches an instruction file by slug and optionally extracts just the deployable instruction text
    async function handleGetInstruction({ slug, instruction_only }) {
      const markdown = await fetchFile(slug);
    
      if (instruction_only) {
        const instruction = extractInstruction(markdown);
        if (!instruction) {
          return {
            content: [{
              type: 'text',
              text: `Could not extract instruction from ${slug}. Returning full file instead:\n\n${markdown}`
            }]
          };
        }
        return {
          content: [{
            type: 'text',
            text: `# Instruction: ${slug}\n\n\`\`\`\n${instruction}\n\`\`\`\n\nFetched from: ${BASE_URL}/registry/${slug}.md`
          }]
        };
      }
    
      return {
        content: [{
          type: 'text',
          text: markdown
        }]
      };
    }
  • Tool schema definition including name, description, and inputSchema with slug (required) and instruction_only (optional) parameters
    {
      name: 'get_instruction',
      description: 'Fetch a complete instruction file from the OpenClaw registry by slug. Returns the full Markdown file including YAML frontmatter, purpose, usage notes, and the deployable instruction text. The instruction is in the "## The Instruction" section.',
      inputSchema: {
        type: 'object',
        properties: {
          slug: {
            type: 'string',
            description: 'The slug of the instruction file (e.g. "tier1-customer-support", "structured-web-research"). Get slugs from search_registry.'
          },
          instruction_only: {
            type: 'boolean',
            description: 'If true, return only the deployable instruction text (extracted from the fenced code block). If false, return the full Markdown file. Default: false.'
          }
        },
        required: ['slug']
      }
    },
  • fetchFile helper function that retrieves the markdown file from the registry by slug
    async function fetchFile(slug) {
      const url = `${BASE_URL}/registry/${slug}.md`;
      const res = await fetch(url);
      if (!res.ok) throw new Error(`File not found: ${slug} (${res.status})`);
      return res.text();
    }
  • extractInstruction helper function that parses markdown to extract just the instruction code block from the '## The Instruction' section
    function extractInstruction(markdown) {
      // Pull out just the fenced code block under ## The Instruction
      const match = markdown.match(/## The Instruction\s*\n[\s\S]*?```[\w]*\n([\s\S]*?)```/);
      if (match) return match[1].trim();
      // Fallback: return everything after ## The Instruction
      const headerMatch = markdown.split(/## The Instruction/);
      if (headerMatch.length > 1) return headerMatch[1].trim();
      return null;
    }
  • index.js:259-261 (registration)
    Tool routing in the CallToolRequestSchema handler - maps 'get_instruction' tool name to the handleGetInstruction function
    switch (name) {
      case 'search_registry': return await handleSearchRegistry(args || {});
      case 'get_instruction': return await handleGetInstruction(args || {});
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 discloses the return format (full Markdown or extracted instruction text) and hints at the structure (YAML frontmatter, sections), but lacks details on error handling, rate limits, or authentication needs. It adds some behavioral context but is not comprehensive.

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 front-loaded with the core purpose, followed by details on return content and parameter implications. Every sentence adds value without redundancy, making it efficient and well-structured for quick understanding.

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 the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is mostly complete. It covers purpose, usage context, and return behavior, but lacks explicit error handling or output examples, which could enhance completeness for an agent.

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?

The input schema has 100% description coverage, so the baseline is 3. The description adds minimal value beyond the schema by mentioning the '## The Instruction' section, which relates to the 'instruction_only' parameter, but does not provide additional syntax or format details. It compensates slightly but not significantly.

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 specific action ('Fetch'), resource ('complete instruction file from the OpenClaw registry'), and distinguishes it from siblings by specifying it retrieves by slug rather than listing categories or searching. It explicitly mentions the return content format, making the purpose unambiguous.

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 provides clear context by stating that slugs should be obtained from 'search_registry', which implicitly guides when to use this tool versus alternatives. However, it does not explicitly state when not to use it or name specific alternatives, keeping it from a perfect score.

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/AgentBase1/mcp-server'

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