Agent skill

Programmatic Tool Calling

by KonghaYao in KonghaYao/peri

Use programmatic tool calling to discover extra tools, compose multiple tool calls in ESM code, and return a compact JSON-compatible result.

Apache-2.0Auto-check passedAI & LLM Engineering

Install Programmatic Tool Calling

skills CLI
$ npx skills add KonghaYao/peri --skill programmatic-tool-calling -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install KonghaYao/peri programmatic-tool-calling --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/KonghaYao/peri.git skills-src && mkdir -p .claude/skills && cp -r skills-src/peri-middlewares/src/skills/builtin/skills/programmatic-tool-calling .claude/skills/programmatic-tool-calling && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
programmatic-tool-calling
GitHub stars
223
Token cost
~822 tokens
SKILL.md length
433 words
Files
1
Skills in repo
19
Repo updated
First seen
Licence
Apache-2.0

At a glance

Use programmatic tool calling to discover extra tools, compose multiple tool calls in ESM code, and return a compact JSON-compatible result.

  • Works in 3 steps: Call SearchExtraTools to locate… → Invoke canonical deferred target… → Use ExecuteExtraTool directly instead…
  • Tasks that involve Structured output and tool calling
  • SKILL.md covers Workflow, Code and result constraints and Security and approvals
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Programmatic Tool Calling is an agent skill from KonghaYao/peri. Use programmatic tool calling to discover extra tools, compose multiple tool calls in ESM code, and return a compact JSON-compatible result.

Its SKILL.md is about 820 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering, covering Structured output and tool calling. The repository describes itself as: Lightweight Rust Agent only use 50MB RAM, but Claude Code Plugin compatible, Dynamic Workflow, Goal, Artifacts, Free Web Search, full feature and better support! The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Structured output and tool calling

Example prompts

  • “/programmatic-tool-calling”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Call SearchExtraTools to locate RunPtcCode and every deferred tool the program needs, and inspect their schemas.
  2. Invoke canonical deferred target RunPtcCode through ExecuteExtraTool with a small ESM program that invokes the discovered tools, checks…
  3. Use ExecuteExtraTool directly instead when no program is needed, or to validate another discovered tool before composing it.

What it can do on your machine

Read from SKILL.md and the folder at commit d7ee444. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Programmatic Tool Calling loads about 822 tokens when it runs. Until then it costs about 42 tokens; SKILL.md has 433 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~42
When it runs · the whole SKILL.md, loaded when a task matches
~822

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from KonghaYao/peri at commit d7ee444, republished under its Apache-2.0 licence (© KonghaYao). 433 words, ~822 tokens.

Download SKILL.mdSave it as .claude/skills/programmatic-tool-calling/SKILL.md (or your agent's skills folder).
name
programmatic-tool-calling
description
Use programmatic tool calling to discover extra tools, compose multiple tool calls in ESM code, and return a compact JSON-compatible result.
aliases
ptc

Programmatic Tool Calling

This builtin skill is named programmatic-tool-calling and keeps the generic alias ptc, so users may invoke it as /ptc.

Use this skill when a task benefits from discovering extra tools and orchestrating several dependent or repetitive calls in one bounded program. It is especially useful for filtering, joining, or summarizing structured tool results without copying large intermediate payloads into the conversation.

Do not use it for a single ordinary tool call, when the required tool is already directly available, for interactive workflows that need user input between steps, or to bypass an approval or access-control boundary.

Workflow

  1. Call SearchExtraTools to locate RunPtcCode and every deferred tool the program needs, and inspect their schemas.
  2. Invoke canonical deferred target RunPtcCode through ExecuteExtraTool with a small ESM program that invokes the discovered tools, checks results, and returns only the JSON-compatible data needed by the task.
  3. Use ExecuteExtraTool directly instead when no program is needed, or to validate another discovered tool before composing it.

The PTC entry pattern is SearchExtraTools → ExecuteExtraTool(RunPtcCode). RunPtcCode is not a direct tool; existing direct tools remain unchanged. The old run_code name is only a search migration keyword, not an executable alias. Never guess an extra tool name or input schema.

Code and result constraints

  • Code runs in an ESM-only function body. Load Node modules only with dynamic await import("node:..."); static import statements and CommonJS require/module.exports are unavailable.
  • Inputs, intermediate tool arguments, and the final return value must be JSON-compatible: objects, arrays, strings, numbers, booleans, or null. Do not return functions, classes, cyclic values, streams, or binary handles.
  • Keep programs bounded. Limit tool-call count, loop iterations, concurrency, output size, and retained intermediate data. Prefer projection and aggregation over returning raw bulk responses.
  • Handle missing fields and tool errors explicitly. Return a compact structured error rather than retrying indefinitely.
Show full SKILL.md (129 more words)Show less

Security and approvals

RunPtcCode does not expand authority. Every discovered tool remains subject to its own security policy, permissions, and approval boundary; policy, HITL, event, and tool-card projections use the effective target. Any assistant raw wrapper call is retained only for protocol pairing. Programmatic composition must not suppress, combine away, or work around approvals. Treat credentials and sensitive tool results as secrets: do not log them, serialize them into diagnostics, or include them in the final result unless the user explicitly needs that data and access is authorized.

Do not use PTC to perform destructive, irreversible, or high-impact actions without the same explicit user authorization required for calling those tools directly. If a tool requires approval or user confirmation, stop at that boundary and let the host request it.

© KonghaYao, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in peri-middlewares/src/skills/builtin/skills/programmatic-tool-calling of KonghaYao/peri.

Open the folder on GitHubat commit d7ee444

Compare with similar skills

Programmatic Tool Calling next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Programmatic Tool Calling compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Programmatic Tool Calling this skillKonghaYao/peri223—~822Automated safety check: PassApache-2.0
Planning With Filesjarrodwatts/claude-code-config1.1k5 repos~967Automated safety check: PassNone
Tool Use Data Synthesissunny-glow/Auto-BenchMax1.3k—~3.3kAutomated safety check: PassNone
Agent Harness ConstructionKartikLabhshetwar/mind-mentor1477 repos~500Automated safety check: PassApache-2.0
Prompt Engineering Patternswshobson/agents40k—~1.3kAutomated safety check: PassMIT
Model Benchmarkstheopenco/llmgateway1.7k—~1.1kAutomated safety check: NotesCustom licence

Similar skills

  • Planning With Files

    jarrodwatts/claude-code-config

    Transforms workflow to use Manus-style persistent markdown files for planning, progress tracking, and knowledge storage.

    1.1k GitHub starsUsed in 5 repos~967 tokens
    AI & LLM EngineeringAuto-check passed
  • Tool Use Data Synthesis

    sunny-glow/Auto-BenchMax

    Synthesize training data for ANY tool-use / agentic benchmark, in ANY repo.

    1.3k GitHub stars~3.3k tokensUpdated 2 mo ago
    AI & LLM EngineeringAuto-check passed
  • Agent Harness Construction

    KartikLabhshetwar/mind-mentor

    Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates.

    147 GitHub starsUsed in 7 repos~500 tokens
    AI & LLM EngineeringAuto-check passed
  • Reference for designing and tuning production LLM prompts: few-shot examples, chain-of-thought, structured outputs, templates and system prompts.

    40k GitHub stars~1.3k tokensUpdated 2 days ago
    AI & LLM EngineeringAuto-check passed
  • Model Benchmarks

    theopenco/llmgateway

    Run and report repository model or provider-mapping benchmarks.

    1.7k GitHub stars~1.1k tokensUpdated today
    AI & LLM EngineeringAuto-check: notes
  • Agent Prompt Quality Bar

    mastra-ai/mastra

    Universal quality bar and final audit rubric for any agent system prompt.

    29k GitHub stars~2k tokensUpdated today
    AI & LLM EngineeringAuto-check passed

More from KonghaYao/peri

All 19 skills in this repo
  • Queries Langfuse traces, prompts, datasets and sessions, and analyzes local LLM gateway logs for requests, context growth, token use and cache hits.

    223 GitHub stars~4.3k tokensUpdated today
    Auto-check: notes
  • Audits recent agent conversation history and turns repeated failures and successes into testable harness improvement proposals that later audits can check.

    223 GitHub stars~3.5k tokensUpdated today
    Auto-check passed
  • Runs commands, reads and edits files, and copies data on remote machines through a single-file Node script that wraps the system ssh and scp, in Chinese.

    223 GitHub stars~924 tokensUpdated today
    Auto-check: warnings
  • Advisor Consultation

    KonghaYao/peri

    Sends a compact, redacted decision packet to a tool-free Opus advisor subagent when a task has high-risk trade-offs or stalled investigations, then weighs the answer.

    223 GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Scheduled Tasks Cron

    KonghaYao/peri

    Registers, lists and removes recurring agent tasks with five-field cron expressions, and sets safety rules so a schedule is created only when the user clearly asks.

    223 GitHub stars~683 tokensUpdated today
    Auto-check passed
  • Verifies and repairs a feature by using the real Peri terminal UI as a user would, looping verify, decide, fix and review until a fresh round shows no blockers.

    223 GitHub stars~2.1k tokensUpdated today
    Auto-check: notes

Questions about Programmatic Tool Calling

What does Programmatic Tool Calling do?

Use programmatic tool calling to discover extra tools, compose multiple tool calls in ESM code, and return a compact JSON-compatible result. Programmatic Tool Calling is an agent skill from KonghaYao/peri. Use programmatic tool calling to discover extra tools, compose multiple tool calls in ESM code, and return a compact JSON-compatible result.

When should I use Programmatic Tool Calling?

Programmatic Tool Calling fits situations like: tasks that involve Structured output and tool calling.

How do I install Programmatic Tool Calling in Claude Code?

Run `npx skills add KonghaYao/peri --skill programmatic-tool-calling -a claude-code`. Or copy the skill folder (peri-middlewares/src/skills/builtin/skills/programmatic-tool-calling in KonghaYao/peri) into .claude/skills/programmatic-tool-calling in your project. Claude Code loads it when a task matches its description.

How do I install Programmatic Tool Calling in Codex?

Run `npx skills add KonghaYao/peri --skill programmatic-tool-calling -a codex`. Or copy the skill folder (peri-middlewares/src/skills/builtin/skills/programmatic-tool-calling in KonghaYao/peri) into .agents/skills/programmatic-tool-calling in your project. Codex loads it when a task matches its description.

Can I use Programmatic Tool Calling in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add KonghaYao/peri --skill programmatic-tool-calling -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/programmatic-tool-calling, .gemini/skills/programmatic-tool-calling, .github/skills/programmatic-tool-calling and .opencode/skills/programmatic-tool-calling in your project.

What does Programmatic Tool Calling need to run?

SKILL.md names no scripts, command-line tools or credentials: Programmatic Tool Calling is instructions for the agent only.

Does Programmatic Tool Calling access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Programmatic Tool Calling safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Programmatic Tool Calling use?

Programmatic Tool Calling is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Programmatic Tool Calling use?

About 822 tokens (SKILL.md is roughly 3.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Programmatic Tool Calling?

Skills that share tags, products or a category with Programmatic Tool Calling: Planning With Files (jarrodwatts/claude-code-config, 1.1k stars), Tool Use Data Synthesis (sunny-glow/Auto-BenchMax, 1.3k stars), Agent Harness Construction (KartikLabhshetwar/mind-mentor, 147 stars) and Prompt Engineering Patterns (wshobson/agents, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Programmatic Tool Calling?

KonghaYao (a GitHub user) maintains it in KonghaYao/peri, which has 223 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on October 7, 2026.

Source: KonghaYao/peri on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.