You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2026/05/04 11:16:18 UTC
(sling-org-apache-sling-mcp-server-contributions) 10/17: chore(mcp-server-contributions): remove the refresh-packages tool
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-mcp-server-contributions.git
commit 769bd8f1fe6ac97ee01373140927e2a6dbf4dd1b
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Mar 12 16:35:21 2026 +0100
chore(mcp-server-contributions): remove the refresh-packages tool
It was never used put to good use and coding assistants like invoking it a lot.
---
.../impl/contribs/RefreshPackagesContribution.java | 74 ----------------------
1 file changed, 74 deletions(-)
diff --git a/src/main/java/org/apache/sling/mcp/server/impl/contribs/RefreshPackagesContribution.java b/src/main/java/org/apache/sling/mcp/server/impl/contribs/RefreshPackagesContribution.java
deleted file mode 100644
index 73246d5..0000000
--- a/src/main/java/org/apache/sling/mcp/server/impl/contribs/RefreshPackagesContribution.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.sling.mcp.server.impl.contribs;
-
-import java.util.List;
-
-import io.modelcontextprotocol.json.McpJsonMapperSupplier;
-import io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncToolSpecification;
-import io.modelcontextprotocol.spec.McpSchema.CallToolResult;
-import io.modelcontextprotocol.spec.McpSchema.Tool;
-import org.apache.sling.mcp.server.spi.McpServerContribution;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.wiring.FrameworkWiring;
-import org.osgi.service.component.annotations.Activate;
-import org.osgi.service.component.annotations.Component;
-import org.osgi.service.component.annotations.Reference;
-
-@Component
-public class RefreshPackagesContribution implements McpServerContribution {
-
- @Reference
- private McpJsonMapperSupplier jsonMapperSupplier;
-
- private final BundleContext ctx;
-
- @Activate
- public RefreshPackagesContribution(BundleContext ctx) {
- this.ctx = ctx;
- }
-
- @Override
- public List<SyncToolSpecification> getSyncToolSpecification() {
-
- var schema = """
- {
- "type" : "object",
- "id" : "urn:jsonschema:Operation",
- "properties" : { }
- }
- """;
-
- return List.of(new SyncToolSpecification(
- Tool.builder()
- .name("refresh-packages")
- .description("Refresh Packages")
- .inputSchema(jsonMapperSupplier.get(), schema)
- .build(),
- (exchange, arguments) -> {
- FrameworkWiring fw = ctx.getBundle(0).adapt(FrameworkWiring.class);
-
- fw.refreshBundles(null);
-
- return CallToolResult.builder()
- .addTextContent("Bundles refreshed successfully")
- .build();
- }));
- }
-}