directify-mcp 1.1.1 → 1.3.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/tools.js +116 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "directify-mcp",
3
- "version": "1.1.1",
3
+ "version": "1.3.0",
4
4
  "description": "MCP server for Directify - manage your directory websites through AI assistants like Claude.",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/tools.js CHANGED
@@ -67,6 +67,7 @@ export const createCategory = {
67
67
  parent_id: { type: 'number', description: 'Parent category ID for nesting' },
68
68
  is_active: { type: 'boolean', description: 'Whether the category is active (default: true)' },
69
69
  order: { type: 'number', description: 'Sort order' },
70
+ head_html: { type: 'string', description: 'Custom HTML injected into the <head> of the category page (e.g. hreflang tags, schema markup)' },
70
71
  },
71
72
  required: ['title'],
72
73
  },
@@ -93,6 +94,7 @@ export const updateCategory = {
93
94
  parent_id: { type: 'number', description: 'Parent category ID' },
94
95
  is_active: { type: 'boolean', description: 'Active status' },
95
96
  order: { type: 'number', description: 'Sort order' },
97
+ head_html: { type: 'string', description: 'Custom HTML injected into the <head> of the category page (e.g. hreflang tags, schema markup)' },
96
98
  },
97
99
  required: ['category_id'],
98
100
  },
@@ -726,6 +728,115 @@ export const togglePage = {
726
728
  },
727
729
  };
728
730
 
731
+ // ─── Organizers ───
732
+
733
+ export const listOrganizers = {
734
+ name: 'list_organizers',
735
+ description: 'List all organizers in a directory, including their associated listings.',
736
+ inputSchema: {
737
+ type: 'object',
738
+ properties: {
739
+ directory_id: { type: 'string', description: 'Directory ID' },
740
+ },
741
+ },
742
+ handler: async ({ directory_id }) => {
743
+ const dir = resolveDirectory(directory_id);
744
+ const data = await api.get(`/directories/${dir}/organizers`);
745
+ return data.data || data;
746
+ },
747
+ };
748
+
749
+ export const getOrganizer = {
750
+ name: 'get_organizer',
751
+ description: 'Get details of a specific organizer, including their associated listings.',
752
+ inputSchema: {
753
+ type: 'object',
754
+ properties: {
755
+ directory_id: { type: 'string', description: 'Directory ID' },
756
+ organizer_id: { type: 'string', description: 'Organizer ID' },
757
+ },
758
+ required: ['organizer_id'],
759
+ },
760
+ handler: async ({ directory_id, organizer_id }) => {
761
+ const dir = resolveDirectory(directory_id);
762
+ const data = await api.get(`/directories/${dir}/organizers/${organizer_id}`);
763
+ return data.data || data;
764
+ },
765
+ };
766
+
767
+ export const createOrganizer = {
768
+ name: 'create_organizer',
769
+ description: 'Create a new organizer in a directory.',
770
+ inputSchema: {
771
+ type: 'object',
772
+ properties: {
773
+ directory_id: { type: 'string', description: 'Directory ID' },
774
+ name: { type: 'string', description: 'Organizer name (required)' },
775
+ slug: { type: 'string', description: 'URL slug (auto-generated from name if not provided)' },
776
+ description: { type: 'string', description: 'Description' },
777
+ email: { type: 'string', description: 'Contact email address' },
778
+ phone: { type: 'string', description: 'Contact phone number' },
779
+ website_url: { type: 'string', description: 'Website URL' },
780
+ social_links: { type: 'object', description: 'Social links as key-value pairs (e.g. {Twitter: "https://..."})' },
781
+ user_id: { type: 'number', description: 'User ID to assign as organizer owner (for submitter dashboard access)' },
782
+ is_active: { type: 'boolean', description: 'Active status (default: true)' },
783
+ order: { type: 'number', description: 'Sort order (default: 0)' },
784
+ },
785
+ required: ['name'],
786
+ },
787
+ handler: async ({ directory_id, ...body }) => {
788
+ const dir = resolveDirectory(directory_id);
789
+ const data = await api.post(`/directories/${dir}/organizers`, body);
790
+ return data.data || data;
791
+ },
792
+ };
793
+
794
+ export const updateOrganizer = {
795
+ name: 'update_organizer',
796
+ description: 'Update an existing organizer.',
797
+ inputSchema: {
798
+ type: 'object',
799
+ properties: {
800
+ directory_id: { type: 'string', description: 'Directory ID' },
801
+ organizer_id: { type: 'string', description: 'Organizer ID to update' },
802
+ name: { type: 'string', description: 'Organizer name' },
803
+ slug: { type: 'string', description: 'URL slug' },
804
+ description: { type: 'string', description: 'Description' },
805
+ email: { type: 'string', description: 'Contact email address' },
806
+ phone: { type: 'string', description: 'Contact phone number' },
807
+ website_url: { type: 'string', description: 'Website URL' },
808
+ social_links: { type: 'object', description: 'Social links as key-value pairs' },
809
+ user_id: { type: 'number', description: 'User ID to assign as organizer owner' },
810
+ is_active: { type: 'boolean', description: 'Active status' },
811
+ order: { type: 'number', description: 'Sort order' },
812
+ },
813
+ required: ['organizer_id'],
814
+ },
815
+ handler: async ({ directory_id, organizer_id, ...body }) => {
816
+ const dir = resolveDirectory(directory_id);
817
+ const data = await api.put(`/directories/${dir}/organizers/${organizer_id}`, body);
818
+ return data.data || data;
819
+ },
820
+ };
821
+
822
+ export const deleteOrganizer = {
823
+ name: 'delete_organizer',
824
+ description: 'Delete an organizer from a directory.',
825
+ inputSchema: {
826
+ type: 'object',
827
+ properties: {
828
+ directory_id: { type: 'string', description: 'Directory ID' },
829
+ organizer_id: { type: 'string', description: 'Organizer ID to delete' },
830
+ },
831
+ required: ['organizer_id'],
832
+ },
833
+ handler: async ({ directory_id, organizer_id }) => {
834
+ const dir = resolveDirectory(directory_id);
835
+ await api.delete(`/directories/${dir}/organizers/${organizer_id}`);
836
+ return { success: true, message: `Organizer ${organizer_id} deleted.` };
837
+ },
838
+ };
839
+
729
840
  // ─── Export all tools ───
730
841
 
731
842
  export const allTools = [
@@ -760,4 +871,9 @@ export const allTools = [
760
871
  updatePage,
761
872
  deletePage,
762
873
  togglePage,
874
+ listOrganizers,
875
+ getOrganizer,
876
+ createOrganizer,
877
+ updateOrganizer,
878
+ deleteOrganizer,
763
879
  ];