@GET
    @TreeResponse
    public ExportedDescribableModel[] doAgentMetadata() {
        List<ExportedDescribableModel> models = new ArrayList<>();

        for (DeclarativeAgentDescriptor d : DeclarativeAgentDescriptor.all()) {
            try {
                DescribableModel<? extends DeclarativeAgent> model = new DescribableModel<>(d.clazz);

                String symbol = symbolForObject(d);
                if ("label".equals(symbol)) { // Label has 2 symbols, but we need "node"
                    symbol = "node";
                }
                models.add(new ExportedDescribableModel(model, symbol));
            } catch (NoStaplerConstructorException e) {
                // Ignore!
            }
        }
        return models.toArray(new ExportedDescribableModel[0]);
    }
@Test
    public void declarativeAgents() throws Exception {
        PipelineMetadataService svc = new PipelineMetadataService();

        List<ExportedDescribableModel> agents = new ArrayList<>(Arrays.asList(svc.doAgentMetadata()));

        assertFalse(agents.isEmpty());

        ExportedDescribableModel m = null;

        for (ExportedDescribableModel a : agents) {
            if (a.getType().endsWith(Label.class.getName())) {
                m = a;
            }
        }

        assertNotNull(m);

        assertTrue(m.getHasSingleRequiredParameter());

        // check there are parameters present
        assertTrue(m.getParameters().size() > 0);
    }