Skip to content

change bucket desc #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mcp_server/consts/consts.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
LOGGER_NAME = "qiniu-s3-mcp"
LOGGER_NAME = "qiniu-mcp"
10 changes: 6 additions & 4 deletions mcp_server/core/storage/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

logger = logging.getLogger(consts.LOGGER_NAME)

_BUCKET_DESC = """When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format ${bucket_name}.s3.${region_id}.qiniucs.com. Path-style requests are not supported. Directory bucket names must be unique in the chosen Availability Zone.
"""

class _ToolImpl:
def __init__(self, storage: StorageService):
Expand Down Expand Up @@ -44,7 +46,7 @@ async def list_buckets(self, **kwargs) -> list[types.TextContent]:
"properties": {
"bucket": {
"type": "string",
"description": "When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format Bucket_name.s3express-az_id.region.amazonaws.com. Path-style requests are not supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3).",
"description": _BUCKET_DESC,
},
"max_keys": {
"type": "integer",
Expand All @@ -70,13 +72,13 @@ async def list_objects(self, **kwargs) -> list[types.TextContent]:
@tools.tool_meta(
types.Tool(
name="GetObject",
description="Retrieves an object from Amazon S3. In the GetObject request, specify the full key name for the object. General purpose buckets - Both the virtual-hosted-style requests and the path-style requests are supported. For a virtual hosted-style request example, if you have the object photos/2006/February/sample.jpg, specify the object key name as /photos/2006/February/sample.jpg. For a path-style request example, if you have the object photos/2006/February/sample.jpg in the bucket named examplebucket, specify the object key name as /examplebucket/photos/2006/February/sample.jpg. Directory buckets - Only virtual-hosted-style requests are supported. For a virtual hosted-style request example, if you have the object photos/2006/February/sample.jpg in the bucket named examplebucket--use1-az5--x-s3, specify the object key name as /photos/2006/February/sample.jpg. Also, when you make requests to this API operation, your requests are sent to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . Path-style requests are not supported.",
description="Retrieves an object from Qiniu bucket. In the GetObject request, specify the full key name for the object. Path-style requests are not supported.",
inputSchema={
"type": "object",
"properties": {
"bucket": {
"type": "string",
"description": "Directory buckets - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format Bucket_name.s3express-az_id.region.amazonaws.com. Path-style requests are not supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3).",
"description": _BUCKET_DESC,
},
"key": {
"type": "string",
Expand Down Expand Up @@ -116,7 +118,7 @@ async def get_object(self, **kwargs) -> list[ImageContent] | list[TextContent]:
"properties": {
"bucket": {
"type": "string",
"description": "Directory buckets - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format Bucket_name.s3express-az_id.region.amazonaws.com. Path-style requests are not supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3).",
"description": _BUCKET_DESC,
},
"key": {
"type": "string",
Expand Down
Loading