agentskills-langchain
LangChain integration for the Agent Skills SDK - turn a skill registry into LangChain tools.
Generates a set of LangChain StructuredTool instances from a SkillRegistry, ready to be passed to any LangChain agent.
Installation
pip install agentskills-langchain
Requires Python 3.12 or newer. Installs agentskills-core and langchain-core as dependencies.
Usage
from pathlib import Path
from agentskills_core import SkillRegistry
from agentskills_fs import LocalFileSystemSkillProvider
from agentskills_langchain import get_tools, get_tools_usage_instructions
# Set up registry
provider = LocalFileSystemSkillProvider(Path("./skills"))
registry = SkillRegistry()
await registry.register("incident-response", provider)
# Build tools + system prompt
tools = get_tools(registry)
catalog = await registry.get_skills_catalog(format="xml")
instructions = get_tools_usage_instructions()
system_prompt = f"{catalog}\n\n{instructions}"
Pass tools to your LangChain agent and inject system_prompt into the system message. The catalog tells the agent what skills exist; the usage instructions tell it how to use the tools.
Generated Tools
| Tool | Parameters | Description |
|---|---|---|
get_skill_metadata |
skill_id |
Get structured metadata (name, description, etc.) |
get_skill_body |
skill_id |
Load the full markdown instructions |
list_skill_resources |
skill_id |
List bundled references, scripts and assets |
get_skill_reference |
skill_id, name |
Read a reference document |
get_skill_script |
skill_id, name |
Read a script |
get_skill_asset |
skill_id, name |
Read an asset |
All tools are async-compatible (StructuredTool with coroutine).
list_skill_resources returns a JSON object keyed by resource kind. Not every backend can enumerate resources — a plain static HTTP host cannot. Rather than surfacing an exception, the tool returns {"supported": false, "note": "..."} in that case: "this cannot be listed" is something the model can act on by falling back to the names in the skill body, not an error worth retrying.
API
get_tools(registry: SkillRegistry, *, max_inline_binary_bytes: int = 65536) -> list[StructuredTool]
Returns a list of LangChain structured tools bound to the given registry.
get_tools_usage_instructions() -> str
Returns a markdown string explaining the progressive-disclosure workflow - read metadata, then body, then fetch resources on demand. Designed for system-prompt injection alongside the skill catalog.
Example
See examples/langchain/ for a full working demo.
Error Handling
| Scenario | Exception |
|---|---|
| Skill not found in registry | SkillNotFoundError |
| Resource not found in skill | ResourceNotFoundError |
| Provider errors (HTTP, filesystem) | AgentSkillsError |
All exceptions inherit from AgentSkillsError (from agentskills-core).
Binary Resources
Skill resources may be arbitrary files. Valid UTF-8 is returned as-is; anything else is returned as a JSON envelope, so a binary payload is never silently mangled into replacement characters:
{
"name": "architecture.png",
"media_type": "image/png",
"size_bytes": 20481,
"encoding": "base64",
"content": "iVBORw0KGgo..."
}
Base64 costs roughly 1.37 characters per byte, so binaries above 64 KiB are described rather than inlined - "encoding": "none" plus a note explaining the omission. Adjust the ceiling with:
tools = get_tools(registry, max_inline_binary_bytes=256 * 1024)
License
MIT
Metadata
Release files for agentskills-langchain 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| agentskills_langchain-0.4.0.tar.gz | 5.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agentskills_langchain-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.7 kB
Release files / agentskills_langchain-0.4.0.tar.gz
| Download URL | agentskills_langchain-0.4.0.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d191e5cbaf996eae38d2108799d1df46dc49438f8acbfe918730103c6b91fe32
|
|
BLAKE2b-256 checksum How to use checksums |
2346cc0060844df212a0f7705c028f32f0a6a06893da3173891cc8602e6679c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency logRelease files / agentskills_langchain-0.4.0-py3-none-any.whl
| Download URL | agentskills_langchain-0.4.0-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3501a2f7a37f1979df8a599bfb5076571f960f1692ae6c09fdc40e7bf02082b6
|
|
BLAKE2b-256 checksum How to use checksums |
837b8f1e6c607e675331ac91bae322776ba13beb8e349dc109e7ebba7108e8b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency log