← Back to Skills Marketplace
hzlpypy

gettangemperors

by hzll · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ Security Clean
241
Downloads
1
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install gettangemperors
Description
Query local backend API for Tang Dynasty emperor information. Use when user asks about Tang emperors, needs to fetch emperor data from local API, or referenc...
README (SKILL.md)

Tang Emperors API

Overview

This skill provides integration with a local backend API that returns information about the first three emperors of the Tang Dynasty (唐朝前3代皇帝). The API is deployed locally at http://127.0.0.1:8080 with the endpoint GET /api/v1/test.

Quick Start

Fetch Tang Dynasty emperor information:

python3 scripts/get_tang_emperors.py

Output formatted as human-readable text:

python3 scripts/get_tang_emperors.py

Output raw JSON:

python3 scripts/get_tang_emperors.py --json

API Details

  • Base URL: http://127.0.0.1:8080
  • Endpoint: /api/v1/test
  • Method: GET
  • Returns: JSON data about the first three Tang Dynasty emperors

Error Handling

The script includes comprehensive error handling:

  • Connection errors: Backend not running or unreachable
  • Timeout errors: API response timeout (10s default)
  • HTTP errors: Invalid HTTP responses (404, 500, etc.)
  • JSON parsing errors: Malformed response data
  • Unexpected errors: Other runtime errors

Usage Patterns

Direct API call:

curl http://127.0.0.1:8080/api/v1/test

Via Python script (recommended):

python3 scripts/get_tang_emperors.py

Programmatic access in Python:

from scripts.get_tang_emperors import get_tang_emperors, format_emperor_data

data = get_tang_emperors()
formatted = format_emperor_data(data)
print(formatted)

Resources

scripts/get_tang_emperors.py

Python client for the Tang Emperors API with:

  • get_tang_emperors(): Fetches raw JSON data from API
  • format_emperor_data(): Formats data for human-readable output
  • CLI support with --json flag for raw JSON output
  • Comprehensive error handling and timeout management

The script can be:

  • Executed directly from command line
  • Imported as a module in other Python code
  • Used by Codex for automated API interactions

Notes

  • Ensure the local backend is running before making API calls
  • The API expects a GET request with no parameters
  • Response format may vary; the script handles common patterns (list, dict with 'emperors' key, dict with 'data' key)
  • Default timeout is 10 seconds; adjust in script if needed for your environment
Usage Guidance
This skill appears coherent and low-risk: it only queries a hard-coded local API and formats results. Before installing, verify that the local service at http://127.0.0.1:8080/api/v1/test is trusted and returns the expected (non-sensitive) data. Note the script requires Python and the 'requests' package even though the metadata lists no required binaries—ensure your environment has those. If you run untrusted agents, be aware that allowing autonomous invocation lets the agent call localhost endpoints; if that is a concern, restrict or review the skill before enabling automatic use.
Capability Analysis
Type: OpenClaw Skill Name: gettangemperors Version: 1.0.1 The skill bundle is a straightforward tool for querying a local API (127.0.0.1:8080) to retrieve historical information about Tang Dynasty emperors. The Python script (scripts/get_tang_emperors.py) uses the standard requests library with appropriate timeouts and error handling, and the SKILL.md instructions are consistent with the code's functionality without any signs of prompt injection or malicious intent.
Capability Assessment
Purpose & Capability
Name/description match the code and instructions: both point to GET http://127.0.0.1:8080/api/v1/test and the included Python script implements that call. There are no unrelated credentials, binaries, or config paths requested.
Instruction Scope
SKILL.md and the script only instruct the agent to call a single local endpoint and format the returned JSON. The instructions do not read files, environment variables, or transmit data to external endpoints beyond the specified localhost API. The only minor scope note: contacting localhost can in general reveal internal data if the local service serves sensitive information, but this skill targets a single fixed endpoint returning emperor data.
Install Mechanism
This is an instruction-only skill (no install spec). The script depends on Python and the 'requests' library, but the skill metadata does not declare required binaries or an install step for dependencies — an operational mismatch rather than a security mismatch. No remote downloads or extract operations are present.
Credentials
No environment variables, credentials, or config paths are requested. The script uses a hard-coded localhost URL and does not attempt to access secrets or external services.
Persistence & Privilege
Skill is not always-enabled and does not request elevated or persistent privileges. It does not modify other skills or system configuration.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install gettangemperors
  3. After installation, invoke the skill by name or use /gettangemperors
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
Initial release of Tang Emperors API skill. - Provides integration with local backend API for information on the first three Tang Dynasty emperors. - Python client script with human-readable and raw JSON output options. - Robust error handling for connectivity, HTTP errors, and response parsing. - Supports direct API calls via curl or programmatic use in Python. - Detailed documentation and usage examples included.
Metadata
Slug gettangemperors
Version 1.0.1
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is gettangemperors?

Query local backend API for Tang Dynasty emperor information. Use when user asks about Tang emperors, needs to fetch emperor data from local API, or referenc... It is an AI Agent Skill for Claude Code / OpenClaw, with 241 downloads so far.

How do I install gettangemperors?

Run "/install gettangemperors" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is gettangemperors free?

Yes, gettangemperors is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does gettangemperors support?

gettangemperors is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created gettangemperors?

It is built and maintained by hzll (@hzlpypy); the current version is v1.0.1.

💬 Comments