@contentful/mcp-tools 0.1.0-dev-20251118T1846-7fe4206.0 → 0.1.0-dev-20251118T2209-4951c6c.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +28 -17
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -800,7 +800,10 @@ var UploadAssetToolParams = BaseToolSchema.extend({
|
|
|
800
800
|
title: z15.string().describe("The title of the asset"),
|
|
801
801
|
description: z15.string().optional().describe("The description of the asset"),
|
|
802
802
|
file: FileSchema.describe("The file information for the asset"),
|
|
803
|
-
metadata: AssetMetadataSchema
|
|
803
|
+
metadata: AssetMetadataSchema,
|
|
804
|
+
locale: z15.string().optional().describe(
|
|
805
|
+
'The locale for the asset fields (e.g., "en-US", "de-DE"). Defaults to "en-US" if not specified.'
|
|
806
|
+
)
|
|
804
807
|
});
|
|
805
808
|
async function tool10(args) {
|
|
806
809
|
const params = {
|
|
@@ -808,11 +811,12 @@ async function tool10(args) {
|
|
|
808
811
|
environmentId: args.environmentId
|
|
809
812
|
};
|
|
810
813
|
const contentfulClient = createToolClient(args);
|
|
814
|
+
const locale = args.locale || "en-US";
|
|
811
815
|
const assetProps = {
|
|
812
816
|
fields: {
|
|
813
|
-
title: {
|
|
814
|
-
description: args.description ? {
|
|
815
|
-
file: {
|
|
817
|
+
title: { [locale]: args.title },
|
|
818
|
+
description: args.description ? { [locale]: args.description } : void 0,
|
|
819
|
+
file: { [locale]: args.file }
|
|
816
820
|
},
|
|
817
821
|
metadata: args.metadata
|
|
818
822
|
};
|
|
@@ -839,7 +843,10 @@ var ListAssetsToolParams = BaseToolSchema.extend({
|
|
|
839
843
|
select: z16.string().optional().describe("Comma-separated list of fields to return"),
|
|
840
844
|
include: z16.number().optional().describe("Include this many levels of linked entries"),
|
|
841
845
|
order: z16.string().optional().describe("Order assets by this field"),
|
|
842
|
-
links_to_entry: z16.string().optional().describe("Find assets that link to the specified entry ID")
|
|
846
|
+
links_to_entry: z16.string().optional().describe("Find assets that link to the specified entry ID"),
|
|
847
|
+
locale: z16.string().optional().describe(
|
|
848
|
+
'The locale to display asset fields in (e.g., "en-US", "de-DE"). Defaults to "en-US" if not specified.'
|
|
849
|
+
)
|
|
843
850
|
});
|
|
844
851
|
async function tool11(args) {
|
|
845
852
|
const params = {
|
|
@@ -858,18 +865,22 @@ async function tool11(args) {
|
|
|
858
865
|
...args.links_to_entry && { links_to_entry: args.links_to_entry }
|
|
859
866
|
}
|
|
860
867
|
});
|
|
861
|
-
const
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
868
|
+
const locale = args.locale || "en-US";
|
|
869
|
+
const summarizedAssets = assets.items.map((asset) => {
|
|
870
|
+
return {
|
|
871
|
+
id: asset.sys.id,
|
|
872
|
+
title: asset.fields.title?.[locale] || "Untitled",
|
|
873
|
+
description: asset.fields.description?.[locale] || null,
|
|
874
|
+
fileName: asset.fields.file?.[locale]?.fileName || null,
|
|
875
|
+
contentType: asset.fields.file?.[locale]?.contentType || null,
|
|
876
|
+
url: asset.fields.file?.[locale]?.url || null,
|
|
877
|
+
size: asset.fields.file?.[locale]?.details?.["size"] || null,
|
|
878
|
+
createdAt: asset.sys.createdAt,
|
|
879
|
+
updatedAt: asset.sys.updatedAt,
|
|
880
|
+
publishedVersion: asset.sys.publishedVersion,
|
|
881
|
+
locale
|
|
882
|
+
};
|
|
883
|
+
});
|
|
873
884
|
const summarized = summarizeData(
|
|
874
885
|
{
|
|
875
886
|
...assets,
|