Skip to content

agent-sdk use skills fail, but I can directly use the skill to return the data. #748

@HappyToSummer

Description

@HappyToSummer

I used this script to call the skill and found that it couldn't retrieve the data, but I can directly use the skill to return the data. They both use the same model, what's the difference

`import asyncio
import os
from claude_agent_sdk import query, ClaudeAgentOptions
from dotenv import load_dotenv

load_dotenv()

async def main():
options = ClaudeAgentOptions(
cwd=os.path.dirname(os.path.abspath(file)),
setting_sources=["user", "project"],
allowed_tools=["Skill", "Read", "Write", "Bash", "WebSearch", "WebFetch"]
)
async for message in query(
prompt="The current time March 26, 2026. Use regional industry searcher skills to help me retrieve the bidding information in the industrial Internet in the last 30 days. Please format and output the markdown file",
options=options
):
print(message)
asyncio.run(main())
`

May I ask which channel is used by default for web search tools? Is it Google?
this is my skill

SKILL.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions